Android应用程序启动问题(堆成长) [英] Android App Startup Problems (Growing Heap)

查看:169
本文介绍了Android应用程序启动问题(堆成长)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有我们的应用程序非常大的问题。
我们需要的位图转换的空间,但
直接启动(的应用程序),大部分内存分配被未知的东西...
下面你可以找到Xamarin Studio中的控制台输出。
怎么可能引发这么大的分配?
应用程序是在不同的设备进行测试,下面的输出是从最差的一个(三星Galaxy S3)

I have a very big Problem with our App. We need much space for Bitmap transformation, but directly at Startup (of the App) most of the Memory gets Allocated with unknown Stuff... Below you can find the Console Output from Xamarin Studio. What could possibly trigger such big allocations? The App is tested on different devices, the Output below is from the Worst One (Samsung Galaxy S3)

这是我的MainActivity的OnCreate中:

This is my OnCreate of MainActivity:

protected override void OnCreate(Bundle bundle)
{
    base.OnCreate(bundle);
    SetContentView(Resource.Layout.Main);
}

控制台输出:

Forwarding debugger port 8808
Detecting existing process
Loaded assembly: /storage/emulated/0/Android/data/com.#AppName#.#AppName#/files        /.__override__/#AppName#.dll
Loaded assembly: Mono.Android.dll [External]
Loaded assembly: System.Core.dll [External]
Loaded assembly: MonoDroidConstructors [External]
[monodroid-debug] Trying to initialize the debugger with options: --debugger-    agent=transport=dt_socket,loglevel=0,address=127.0.0.1:8808,server=y,embedding=1
[libc] WARNING: generic atexit() called from legacy shared library
[Mono] Image addref mscorlib[0x57bc76f0] -> mscorlib.dll[0x41d0f588]: 1
[Mono] AOT module 'mscorlib.dll.so' not found: dlopen failed: library "/data        /data/com.#AppName#.#AppName#/lib/mscorlib.dll.so" not found
[Mono] Assembly mscorlib[0x57bc76f0] added to domain RootDomain, ref_count=1
[Mono] Assembly Loader probing location: '/storage/emulated/0/Android        /data/com.#AppName#.#AppName#/files/.__override__/#AppName#.dll'.
[Mono] Image addref #AppName#[0x57bc9dd8] -> /storage/emulated/0/Android        /data/com.#AppName#.#AppName#/files/.__override__/#AppName#.dll[0x57bc9008]: 2
[Mono] Assembly #AppName#[0x57bc9dd8] added to domain RootDomain, ref_count=1
[Mono] AOT module '/storage/emulated/0/Android/data/com.#AppName#.#AppName#/files/.__override__/#AppName#.dll.so' not found: dlopen failed: library "/data    /data/com.#AppName#.#AppName#/lib//storage/emulated/0/Android/data/com.#AppName#.#AppName#/files/.__override__/#AppName#.dll.so" not found
[Mono] Assembly Loader loaded assembly from location: '/storage/emulated/0/Android/data/com.#AppName#.#AppName#/files/.__override__/#AppName#.dll'.
[Mono] Config attempting to parse: '/storage/emulated/0/Android/data/com.#AppName#.#AppName#/files/.__override__/#AppName#.dll.config'.
[Mono] Config attempting to parse: '/Users/builder/data/lanes/1131/2a7b6821/source/monodroid/builds/install/mono-armv7/etc/mono/assemblies/#AppName#/#AppName#.config'.
[monodroid-gc] GREF GC Threshold: 46800
[Mono] Image addref Mono.Android[0x57bcac10] -> Mono.Android.dll[0x57bca250]: 1
[Mono] Assembly Mono.Android[0x57bcac10] added to domain RootDomain, ref_count=1
[Mono] AOT module 'Mono.Android.dll.so' not found: dlopen failed: library "/data/data/com.#AppName#.#AppName#/lib/Mono.Android.dll.so" not found
[Mono] Assembly Ref addref Mono.Android[0x57bcac10] -> mscorlib[0x57bc76f0]: 2
[Mono] Image addref System.Core[0x59182658] -> System.Core.dll[0x59181a40]: 1
[Mono] Assembly System.Core[0x59182658] added to domain RootDomain, ref_count=1
[Mono] AOT module 'System.Core.dll.so' not found: dlopen failed: library "/data/data/com.#AppName#.#AppName#/lib/System.Core.dll.so" not found
[Mono] Assembly Ref addref Mono.Android[0x57bcac10] -> System.Core[0x59182658]: 2
[Mono] Assembly Ref addref System.Core[0x59182658] -> mscorlib[0x57bc76f0]: 3
[Mono] Assembly Ref addref #AppName#[0x57bc9dd8] -> Mono.Android[0x57bcac10]: 2
[Mono] DllImport attempting to load: '__Internal'.
[Mono] DllImport loaded library '(null)'.
[Mono] DllImport searching in: '__Internal' ('(null)').
[Mono] Searching for '_monodroid_gc_wait_for_bridge_processing'.
[Mono] Probing '_monodroid_gc_wait_for_bridge_processing'.
[Mono] Found as '_monodroid_gc_wait_for_bridge_processing'.
[Mono] DllImport searching in: '__Internal' ('(null)').
[Mono] Searching for '_monodroid_get_identity_hash_code'.
[Mono] Probing '_monodroid_get_identity_hash_code'.
[Mono] Found as '_monodroid_get_identity_hash_code'.
[Mono] Assembly Ref addref #AppName#[0x57bc9dd8] -> mscorlib[0x57bc76f0]: 4
[Mono] DllImport searching in: '__Internal' ('(null)').
[Mono] Searching for '_monodroid_gref_log_new'.
[Mono] Probing '_monodroid_gref_log_new'.
[Mono] Found as '_monodroid_gref_log_new'.
[dalvikvm-heap] Grow heap (frag case) to 12.344MB for 2005072-byte allocation
[dalvikvm-heap] Grow heap (frag case) to 19.993MB for 8020240-byte allocation
[dalvikvm-heap] Grow heap (frag case) to 32.004MB for 11632656-byte allocation
[Mono] DllImport searching in: '__Internal' ('(null)').
[Mono] Searching for '_monodroid_gref_log_delete'.
[Mono] Probing '_monodroid_gref_log_delete'.
[Mono] Found as '_monodroid_gref_log_delete'.

感谢您的帮助!

编辑:

在清单使用LargeHeap于事无补。
而当我加载应用程序,而不布局可言,堆大小也增长到19MB。

Using LargeHeap in Manifest does not Help. And when I load the App without a Layout at All, the Heap Size is also growing to 19mb.

推荐答案

我发现这个问题。
在我的绘制文件夹没有正确的icon.png。
我使用的图标具有708x708的分辨率。我有一个较小的一个替代它,现在它的工作原理...
感谢您对埃尔詹我推在正确的方向。

I found the Problem. In my drawable Folder was not the correct Icon.png. The Icon I used had a Resolution of 708x708. I replaced it with a smaller one, now it works... Thank you Ercan for pushing me in the right direction.

这篇关于Android应用程序启动问题(堆成长)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆