My CF application has a very customized UI, using lots of images as UI elements. The UI feels a lot more smooth when these bitmaps are kept in memory. When they re loaded on demand, the UI is slow and I can see the buttons appearing one by one, which looks very poor. For a long time this went pretty well, but recently I ve found the application nearly uses all the memory it can get, which is 32MB iirc. I then started using the remote performance monitor to see if I could find any clear memory hogs.
As it turns out, getting a useful snapshot of the GC heap using RPM is hard: close before I m likely to receive out of memory exceptions, requesting a snapshot causes a native exception to be thrown instantly. I can manage to find a GC snapshot once in a while though. I saved one here: http://files.zzattack.org/misc/ramis.gclog and a screenshot here: http://files.zzattack.org/images/ramisgcsnapshot.png To me it doesn t look all that troublesome, by far the largest object is a byte array containing my resources file (about 3MB full of PNG images). Alltogeher, 3643304b (about 3.5MB) of memory is used. These images are spread over UI elements in about 20 different forms. I m don t know what impact seperate threads have on memory usage, but about 5-6 threads are running simultaneously, of which at least 4 are in a blocked state 95% of the time.
在该方案中,当我试图下载2MBgzipped文档时,我总是会收到外观。 当我打电话给GC.GetTotalMemory(false)时,我看到,我确实试图分配比现在更多的资金。 《使用GC》。 收集和再次试图解决我的问题。
我想就如何解决我的问题提出一些建议。 我绝对想要的是记号,但也许我可以限制用于比图的排位数,只保留最经常需要的时间,并按要求装载他人。 这很可能是一颗长枪,但也许我可以要求监督厅为我保留更多的记忆? 我确信,申请将只使用有足够长的援助团可用装置。 事先感谢任何帮助。