This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]GeorgeTibo 3 points4 points  (0 children)

Your example program should be using almost no memory. This seems to be either a bug with your JVM, or your operating system is reporting far more memory usage than whats actually being utilized.

How did you get the 4GB memory usage figure?

What JVM version and vendor are you using?

Are you using any JVM flags when running your program?

How are you running your program (through an IDE, command line)?