LibGDX provides an interface for accessing memory usage, but this doesn't say the memory available or heap size. I implemented Runtime.getRuntime().totalMemory(), which may not work on other platforms, and other platforms may have better accessors to this kind of profiling data (e.g., android has android.os.Debug.getNativeHeapAllocatedSize(). This type of profiling needs to be abstracted on a per-platform basis.
I don't anticipate this causing an issue for a while. Checking the LibGDX backend implementations, gwt simply returns 0 for the memory usage functions and android has an android-specific return for native heap. The android stuff will become important when optimization starts to become a priority, since those devices are far less capable than desktops.
LibGDX provides an interface for accessing memory usage, but this doesn't say the memory available or heap size. I implemented
Runtime.getRuntime().totalMemory()
, which may not work on other platforms, and other platforms may have better accessors to this kind of profiling data (e.g., android hasandroid.os.Debug.getNativeHeapAllocatedSize()
. This type of profiling needs to be abstracted on a per-platform basis.I don't anticipate this causing an issue for a while. Checking the LibGDX backend implementations,
gwt
simply returns0
for the memory usage functions andandroid
has an android-specific return for native heap. The android stuff will become important when optimization starts to become a priority, since those devices are far less capable than desktops.