Package org.javarosa.core.util
Class MemoryUtils
java.lang.Object
org.javarosa.core.util.MemoryUtils
public class MemoryUtils extends Object
J2ME suffers from major disparities in the effective use of memory. This
class encompasses some hacks that sadly have to happen pertaining to high
memory throughput actions.
This was implemented in a hurry, and urgently needs a major refactor to be less...
hacky, static, and stupid.
- Author:
- ctsims
-
Constructor Summary
Constructors Constructor Description MemoryUtils() -
Method Summary
Modifier and Type Method Description static voidenableMemoryProfile()static voidprintMemoryTest()Prints a memory test debug statement to stdout.static voidprintMemoryTest(String tag)Prints a memory test debug statement to stdout with a tag to reference Requires memory printing to be enabled, otherwise is a no-opstatic voidprintMemoryTest(String tag, int pause)Prints a memory test debug statement to stdout with a tag to reference.static voidprofileMemory()Experimental.static voidrevertTerning()static voidstopTerning()
-
Constructor Details
-
MemoryUtils
public MemoryUtils()
-
-
Method Details
-
stopTerning
public static void stopTerning() -
revertTerning
public static void revertTerning() -
enableMemoryProfile
public static void enableMemoryProfile() -
printMemoryTest
public static void printMemoryTest()Prints a memory test debug statement to stdout. Requires memory printing to be enabled, otherwise is a no-op -
printMemoryTest
Prints a memory test debug statement to stdout with a tag to reference Requires memory printing to be enabled, otherwise is a no-op- Parameters:
tag-
-
printMemoryTest
Prints a memory test debug statement to stdout with a tag to reference. After printing the message the app waits for Pause milliseconds to allow profiling Requires memory printing to be enabled, otherwise is a no-op- Parameters:
tag-pause-
-
profileMemory
public static void profileMemory()Experimental. This method builds a profile of what the current memory allocation looks like in the current heap. You must initialize the profiler once in your app (preferably immediately upon entering) to pre-allocate the space for the profile.
-