Skip to content
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

Entry editor produces constant load #3943

Closed
stefan-kolb opened this issue Apr 10, 2018 · 12 comments
Closed

Entry editor produces constant load #3943

stefan-kolb opened this issue Apr 10, 2018 · 12 comments

Comments

@stefan-kolb
Copy link
Member

stefan-kolb commented Apr 10, 2018

When the entry editor is opened I experience constant high load from JabRef.
This needs to be evaluated and fixed!

image

When I close the entry editor load immediately goes down to idle.

@stefan-kolb stefan-kolb added type: performance bug Confirmed bugs or reports that are very likely to be bugs and removed bug Confirmed bugs or reports that are very likely to be bugs labels Apr 10, 2018
@stefan-kolb stefan-kolb added this to the v4.3 milestone Apr 26, 2018
@stefan-kolb
Copy link
Member Author

stefan-kolb commented May 24, 2018

It looks like JR is producing events? in such cases.
The classes that are created over and over are:
AccessControlContext, EventQueueItem, WeakReference
After some time the garbage collector kills all of them and the climb to the peak starts again.
@JabRef/developers What could cause this? We really need to find out...

image

What also causes constant memory increass is the creation of int[] but a lot slower than the rest of the problems and without CPU load.

Just clicking through the entries heavily increases the memory footprint and CPU load with open entry editor:
image

Actually removing a linked file causes the CPU leak. It is even enough to keep the General tab open as it seems...
image

Maybe the binding implementation has bugs?!

        BindingsHelper.bindContentBidirectional(
                files,
                text,
                LinkedFilesEditorViewModel::getStringRepresentation,
                this::parseToFileViewModel);

Unfortunately I could also cause the issue by just opening the entry editor and closing it again without doing anything else...
BUT clicking the general tab ALWAYS works immediately.

@stefan-kolb stefan-kolb changed the title Open entry editor produces constant load Open entry editor produces constant load (Caused by _General tab_) May 24, 2018
@stefan-kolb stefan-kolb changed the title Open entry editor produces constant load (Caused by _General tab_) Open entry editor produces constant load (Caused by General tab) May 24, 2018
@stefan-kolb stefan-kolb changed the title Open entry editor produces constant load (Caused by General tab) Open entry editor produces constant load May 24, 2018
@stefan-kolb stefan-kolb changed the title Open entry editor produces constant load Entry editor produces constant load May 24, 2018
@stefan-kolb
Copy link
Member Author

stefan-kolb commented May 24, 2018

@stefan-kolb
Copy link
Member Author

I just need to click tab titles and after a while the leak starts!

@stefan-kolb stefan-kolb added the bug Confirmed bugs or reports that are very likely to be bugs label May 24, 2018
@tobiasdiez
Copy link
Member

The EventQueueItem is an awt class while WeakReference is used for the JavaFX binding. Maybe, this memory/cpu leak happens because swing and javafx don't interact nicely? Does the same problems occur on the maintable beta branch?

Is there a way to find the code that generates these classes?

@stefan-kolb
Copy link
Member Author

stefan-kolb commented May 25, 2018

I couldn't find anything yet, also I'm not so much into these code parts.

@stefan-kolb
Copy link
Member Author

I couldn't reproduce the constant load on the maintabl branch with a few tests yet, although I am experiencing this phenomen when cycling through the entries (memory spike/leak again):

image

@stefan-kolb
Copy link
Member Author

stefan-kolb commented May 25, 2018

Looks like AWT is creating InvocationEvents all the time:

java.awt.event.InvocationEvent[INVOCATION_DEFAULT,runnable=sun.awt.windows.WInputMethod$1@3eb272aa,notifier=null,catchExceptions=false,when=1527251549510] on org.jabref.gui.maintable.MainTable[,0,0,1896x8400,alignmentX=0.0,alignmentY=0.0,border=,flags=251658600,maximumSize=,minimumSize=,preferredSize=,autoCreateColumnsFromModel=true,autoResizeMode=AUTO_RESIZE_ALL_COLUMNS,cellSelectionEnabled=false,editingColumn=-1,editingRow=-1,gridColor=java.awt.Color[r=210,g=210,b=210],preferredViewportSize=java.awt.Dimension[width=450,height=400],rowHeight=25,rowMargin=0,rowSelectionAllowed=true,selectionBackground=javax.swing.plaf.ColorUIResource[r=0,g=120,b=215],selectionForeground=javax.swing.plaf.ColorUIResource[r=255,g=255,b=255],showHorizontalLines=false,showVerticalLines=false]

This is the runnable:

runnable=sun.awt.windows.WInputMethod$1@48d09dd6

Possibly related? http://mail.openjdk.java.net/pipermail/awt-dev/2018-January/013479.html

Looks like it is the case.

@stefan-kolb
Copy link
Member Author

As far as I can tell this is a JVM bug and is fixed in 1.8.0_172 😢
Will keep an eye on this tho...

@stefan-kolb
Copy link
Member Author

Maybe we should fix our Java version to 8u172 and up. Or at least warn the user?

stefan-kolb added a commit that referenced this issue May 25, 2018
@stefan-kolb stefan-kolb mentioned this issue May 25, 2018
@tobiasdiez
Copy link
Member

depends a bit on how bad the leak is. If it makes JabRef/the system unusable we should set 172 as minimum. If its not that bad I would vote for ignoring it (we can always tell people to upgrade if they complain...)

@Siedlerchr
Copy link
Member

I see no problem bumping the minimum version. Only the latest jdk is supported and often fixes security things.

@stefan-kolb
Copy link
Member Author

For me this lead to my fan running on maximum all the time on my laptop.
And my machine isn't that old and slow.
I have no idea what this means for slower machines.

I'm not 100% convinced either, tho.

@stefan-kolb stefan-kolb removed the bug Confirmed bugs or reports that are very likely to be bugs label May 30, 2018
stefan-kolb added a commit that referenced this issue Jun 1, 2018
Siedlerchr added a commit that referenced this issue Jun 1, 2018
…leType

* upstream/master:
  Show development information
  Release v4.3
  Remove invalid test and fix another
  CPU leak #3943 (#4058)

# Conflicts:
#	CHANGELOG.md
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants