1

I'm developping a javafx application which has much ui interfaces, and while opening many windows, the jvm start consumming much memory (going up tp 350mb).

When it arrives to 360mb, the programs starts lagging and end up by being crashed (nothing works, screen blocks ...) and the console show a OutOfMemoryException with Java Heap Space error

I've 6gb of memory in my computer, and tried to start the .jar file using -Xmx param, but still the operating system doesn't allow the jvm to consume more memory.

Is there anything else i should specify so that the jvm may be able to get as much memory as it needs ?

4
  • 6
    Show the arguments you're using to incrwsde the size. Commented Sep 21, 2019 at 20:33
  • Let me summarize the problem with my own words: the question is how to use machine learning for garbage collection improvement under the special requirement of efficient memory usage. A concrete algorithm wasn't given, so it's perhaps a simple reinforcement learning issue. Commented Sep 21, 2019 at 20:38
  • You could look at javarevisited.blogspot.com/2011/09/… as it may not be heap. You could also use a memory visualization to see what is the actual cause. medium.com/@krishankantsinghal/… Commented Sep 21, 2019 at 21:21
  • Thanks for the tips guys i was giving the 1024 as a param to the application instead of the jvm ... sorry for late answer... now the app reaches 650mb and doesn't crash at all, it's fine but isn't 650mb a little bit tooo much ? (i've got a rich user interface) .. by the way i'll try those memory visualization tools to find out a clue ! Commented Oct 1, 2019 at 9:22

1 Answer 1

2

You might want to ensure that you're using:

java -Xmx1024m -jar YourApplication.jar

and not:

java -jar YourApplication.jar -Xmx1024m

Anything after the .jar is considered as argument passed to your executable Jar.

Sign up to request clarification or add additional context in comments.

1 Comment

Thanks ! Amazing ! , now my application can reach 650mb and doesn't crash anymore ! i was writing the command wrongly :/ ... but 650mb isn't too much ? (got a rich user interface) .. sorry for late answer

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.