I have an application that creates a series of bitmaps. I keep these bitmaps in SoftReferences to avoid running out of memory. I would like the heap size to grow to a maximum of 16 MB before it starts collecting my SoftReferences. However, SoftReferences are collected very willingly, before the heap is maximized. Is there a way to make links assemble less readily? or manually increase the heap to the maximum? Perhaps a way to just run the application with 16 MB allocated?
There is currently no way to change the behavior of the SoftReference collection.
, " ".
Bitmap ( - ), , " ", . (, , GC, GC. , , GC OOM.)
. VM , , , "" , .
: http://code-gotcha.blogspot.com/2011/09/softreference.html
Source: https://habr.com/ru/post/1778136/More articles:Appearance DatePicker - androidIronpython 2.6.1 on Silverlight 4 - ironpythonEnabling various functions depending on the version of iOS - iosConfiguring xUnit for CUnit in Hudson CI - hudsonphp regexp for national domains - phpASP.NET MVC creates subdomain URL in view - asp.net-mvcС# Масштабирование позиций GDI, но не размер шрифта или толщина линии - c#Hibernate Query Slow Index - performanceCan you upload a random file every time you click the same button using jQuery? - jqueryForest Controllers in ASP.NET MVC - asp.net-mvcAll Articles