profiler not showing decreasing Runtime.getRuntime().freeMemory() allocations
Here's an odd one I'm hoping people can help me with.
I'm writing a game, and am printing Runtime.getRuntime().freeMemory() onto the screen every frame.
What I'm finding is that the memory is starting at about 125 meg, and quite rapidly decreasing to about 50 meg, then jumping up to 125 meg (or there abouts) again, and then doing it again, and so on.
This suggested to me that a huge amount of memory is being allocated and discarded, and then freed by the garbage collector.
So I've profiled it in netbeans, and have taken a snapshop when it's at 125 meg and various others between, as I approach 50 meg.
But when comparing the profile reports, I see absolutely no new allocations accounting for that amount of memory. A meg or two at the most in small point / position classes, iterators and such, but that's it.
I'd like to be able to rely on having > 100 meg but I worry if I drop below 75 as the peak I'll run out of memory at the end of these cycles. Or will the GC run earlier / more frequently to compensate?
Anyone got any ideas what I could look for to find where this memory is going? :S
Thanks in advance,