-
Notifications
You must be signed in to change notification settings - Fork 236
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Possible memory leak #159
Comments
Can you test how the heap usage evolves with time and garbage collection? For example
If you see a significant increase between 2. and 3., can you please provide a reproducible example? Thanks. |
Hi Tomas. I did something a bit different, but hopefully easier for you to look at. I wrote a simple app that recreates the problem. It has 4 tabs, first two with StyleClassedTextArea and the other two with TextArea. The reason for two each is that I was suspecting it was to do with hidden tabs, but that doesn't seem to be the case. Also attached a screenshot from jconsole, with a summary from 3 runs. On the left - only updating a TextArea tab, max memory usage about 45MB, low CPU usage. The middle and the right ones are updating the StyleClassedTextArea tabs (first and both tabs respectively). You can see the memory usage going to almost 900MB, and with high CPU usage. After a while it doesn't do much processing but runs at high CPU, so I believe it is doing constant GCs (the count keeps increasing every second for majors). Also tried doing manual GCs but not much difference. The sample app: https://drive.google.com/open?id=0B3K44MOFJ2-PR1lsUTB3amlXem8 |
Thanks, I found a leak, which is an instance of "Problem 2" from my blog post on The Trouble with Weak Listeners. I will report this specific instance to the JavaFX team. This leak is very specific to your example, namely, when there are many updates of a paragraph, without moving the caret in and out of that paragraph. Can you confirm that the memory is reclaimed when you move the caret to the next line (and run GC)? |
Here is the issue I reported: https://bugs.openjdk.java.net/browse/JDK-8130458 |
So the above mentioned JDK bug has been fixed, but is not released yet and it is unsure whether the fix will be backported to some JDK 8 update release. Therefore, I created a workaround for it in version 0.6.7. |
Hi Tomas. Many thanks for sorting it out and for the update. I'll go to the latest version. Cheers! |
Hi! Recently I've noticed that my app is running out of memory. I took a heap dump and saw a lot of references to org.reactfx.* and org.fxmisc.*
Attached is a screenshot from MAT.
In this particular case, the data field was updated about 300 times per second by doing:
dataField.clear();
dataField.appendText(textToDisplay);
dataField.setStyleClass(0, dataField.getText().length(), "messageText");
The dataField is an instance of StyleClassedTextArea. Using 0.6.3.
Any help appreciated!
The text was updated successfully, but these errors were encountered: