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

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?

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.