Hi all.
I've got a program that obtains information from various sensors. It works fine, but I'm paranoid about the garbage collection not kicking in later on in the future.
Using VisualVm, I've noticed that every time it gets a sample of the heap, a few bytes keep on being allocating. I cannot see when the GC will kick-in to free up memory.
Because I've this I decided to code this simple program and observe the contents of the heap:
Here are my results:
As you can see, the memory usage keeps on increasing (only a few bytes).
I'm thinking if this is to do when the
thread it sleeping and being woken up. The few bytes is the overhead of this (I could be wrong)
Does the GC kick in when the memory usage exceeds a certain threshold.
Thanks for your time and help.