Java/Eclipse: How Does Java/Eclipse Reserve Heap -


i trying diagnose memory leak (or thought memory leak) in real time audio program, causes output "stutter" when garbage collection routine called.

in attempt basics , elaborate successively until found leak, devised thought simplest possible , leak-free program:

public class leakdetect {     public static void main(string args[]) {         while (true) {             system.out.println( runtime.getruntime().freememory());         }     } } 

imagine surprise find heap space decreases on time (easily visible on course of seconds) , jumps again, though there no action here other printing available heap memory.

i have never had cause wonder this; going on here?

does java/eclipse forcibly reserve chunk of memory heap, , subsequently wasteful behind scenes?

or, suspect, other programs , os functions (windows 10) eating potential heap space available, , os freeing memory? if so, there way make java/eclipse take harder line keeping os , other software out of space? running under ubuntu change answer?


Comments

Popular posts from this blog

javascript - jQuery: Add class depending on URL in the best way -

caching - How to check if a url path exists in the service worker cache -

Redirect to a HTTPS version using .htaccess -