2

1) We Created a Restaurant POS using JavaFX.

2) We have one main application and all other activity will open in Dialog which extend stage. This Stages are in memory always even after closing the stage using stage.close().

3) The worse case is if I open the dialog multiple time memory leak is happening.

eg: first call of stage need 30 MB memory next call to stage cause 60 MB usage and will continue like this 30MB, 60MB, 90MB, 120MB....................etc.

4) We took a painful approach to solve this issue once waiter ordered and click finish button we call System.exit(0) and reopen the jar file using

Process proc = Runtime.getRuntime().exec("java -jar BookingFX.jar");

so every time the waiter have to wait a little to reopen the application.

5) As programmers we got very a bad image because this memory leak, We did this POS using SpringFrame work and MySQL and it is a three month of effort and I am the one who suggested the JavaFX for development instead of swing . We tried JDK8 early access to check for any hope but failed. Now our boss is asking us to move towards Windows programming using Visual C++ or Any other platform.

  • 1
    This question sounds similar to: http://stackoverflow.com/questions/1473510/general-strategy-to-resolve-java-memory-leak – James A Mohler Dec 28 '13 at 05:53
  • 2
    Also, there are times to move to new programming platforms. Solving memory leaks is not one of them. – James A Mohler Dec 28 '13 at 05:53
  • 1
    Memory leaks may have several causes. Without the actual code (preferably a cut-down version of the code that reproduces the problem) it is difficult to help you. And both points from James are valid too. – Nikos Paraskevopoulos Dec 28 '13 at 09:30
  • Thankyou james Mohler and Nikos Praskevopoulos we figure it out. All the Dialog we make it static and load when program startup. After that we just initialize the content while loading and when user press close button we clear the content and hide the dialog instead of dispose. Now our program is fast and it is running in our restaurant. – Sreejesh Ellath Jan 18 '14 at 05:47
  • We Made First Scene and that will stay active until program close, remaining all scene are Dialog and all the dialog we opened at the startup itself and it will show and hide according to user click. Now our memory is fine. and we stop using ObservableList to store data except for table and List. ObservableList is always staying in memory. – Sreejesh Ellath Jan 18 '14 at 05:50
  • If the Problem is fixed. Please close the question. – Marcel Jun 12 '15 at 06:44

0 Answers0