Reputation: 1649
I have to create a RMI program,when i run this program it will run only few minutes then show "java.lang.outofmemoryError: java heap space" problem. I have to use Window 7 with 1.5 GB RAM and JDK1.6
Thanks,
Upvotes: 0
Views: 2073
Reputation: 1677
This can be a one of several things.
java -Xms128m -Xmx512m ...
Upvotes: 0
Reputation: 75406
Memory leak. Use jvisualvm in the jdk to find out why.
Upvotes: 0
Reputation: 266
Smells memory leak. Although Java does garbage collection, you still need to make sure you don't hold onto (strong reference) to objects that you no longer need. For example, if you do not unregister event handlers (and event handler boilerplate code holds strong reference to the handlers), those handlers will never be collected and thus memory leak.
Without knowing more of your program, we can just guess here.
Upvotes: 1
Reputation: 55937
You may simply need to increase your maximum heap size using the -Xmx option.
You could read this tuning guide
Upvotes: 0