LWJGL Forum

Programming => Lightweight Java Gaming Library => Topic started by: XenoAmess on December 29, 2018, 12:27:39

Title: [SOLVED]How can I know how much memory am I using when using BufferUtils?
Post by: XenoAmess on December 29, 2018, 12:27:39
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?
 ;)
Title: Re: How can I know how much memory am I using when using org.lwjgl.BufferUtils?
Post by: spasi on December 29, 2018, 13:47:13
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.
Title: Re: How can I know how much memory am I using when using org.lwjgl.BufferUtils?
Post by: XenoAmess on December 29, 2018, 14:04:37
;) I will do it manually then.
Thanks for your help.