returns free memory available from heap double memoryAvailable = Runtime.getRuntime().maxMemory() - (heapSize - heapRemaining) - nativeUsage;
FreeMem2AsLong
returns freeMemory long freeMemory = (Runtime.getRuntime().maxMemory()) - (Debug.getNativeHeapAllocatedSize());
Garbage
Runs the Garbage Collector to free memory Make sure your code is good first you are not initializing bitmaps aggressively No amount of System.gc() calls will help a memory leak You should split up the work and cache your data to file(s) and remove objects accordingly. If you really need more memory you should run your java app with larger heap memory set
returns a simple bitmap dont use file.dirassets ever, copy image over to another place from project example: Activity.loadbitmap(mm.GetSafeBitmap(File.DirInternal,"/moon.jpg",Activity.height,Activity.width)) If this runs into memory problems, it's going to load a really low res image which will look bad but it might not crash the app
loadbitmap2(String Directory, String Filename, Integer SampleSize, Boolean RGB565) returns a safe sized bitmap dont use file.dirassets ever, copy image over to another place from project example: Activity.SetBackgroundImage(mm.loadbitmap2(File.DirInternal,"/moon.jpg",8)) SampleSize, can be 2, 4, ,6, 8,....16, 32...etc RGB565=True will set options.inPreferredConfig = Config.RGB_565;