Reputation: 4073
I'm a beginner in the domain of JVM, but I noticed that when Swing components are used, like JFrame, the Eden space usage constantly increases (at constant speed I suppose, since the graph plotted in VisualVM is a rising straight line), until the GC sends it back to the lowest point. As the Eden space is used for newly created objects, I wonder what is constantly creating those objects, and if the same effect still happens without Swing components.
[Edit]
After looking at the heap dump, I found that the objects created are of type char[] and int[]. What's are those objects for?
Upvotes: 2
Views: 4440
Reputation: 8874
The problem actually may be caused by profiling with VisualVM, see this.
Upvotes: 1
Reputation: 2286
The JVM creates new objects in Eden space so it is OK if it rises in a straight line until the GC clears it out. Java memory is managed in "generations" and objects are moved from the youngest generation (Eden) to Perm depending on how old they are.
Tuning Garbage Collection with the 5.0 Java[tm] Virtual Machine is a good article about memory management in Java.
Upvotes: 4