[SOLVED]How can I know how much memory am I using when using BufferUtils?

Started by XenoAmess, December 29, 2018, 12:27:39

Previous topic - Next topic

XenoAmess

I'm developing a game and I planned to do some garbage collection when I am holding some size of memories with org.lwjgl.BufferUtils in total,like, 4G or so, then I can just find some latest unused textures and delete them.
So, I will be super happy if there be some way to get the total size of holding buffers which is allocated by org.lwjgl.BufferUtils. Or should I track it myself?
;)

spasi

There's MemoryUtil.memReport but it has limitations: it only tracks allocations via MemoryUtil and Configuration.DEBUG_MEMORY_ALLOCATOR must be enabled. There's overhead, so it's not enabled by default. A custom solution would be better if you need memory tracking in release builds.

XenoAmess