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
Eclipse maven workspace is too slow with bnd plugin #3415
Comments
@rotty3000 Can you look into this? |
hey @prafullp I was not able to reproduce this with the latest Bndtools 4.3.0RC1 available here: https://bndtools.jfrog.io/bndtools/releasecandidate/ But all I did was clone your example repo, import the project and and then open the devenv.bndrun file. It opened quickly, or at least I perceived it as quick. |
Hey @gamerson . Thanks for your quick response. The problem is visible more when you have more complicated set of projects. In order to make it visible I have downloaded YCSB project from github and added bnd.bndrun file in cassandra-binding project. So if you re-import the workspace you would see the slowness. On my machine it took 43 seconds for the file to open. File opening is not the only problem that we have. Because of the same reason, the launch of application and debugging it is also too slow. Please note that you will not be able to run this project as I didn't intend to do that. I am hoping if there are fixes, the same fix will lead to solution of all other problems. I have not checked the behavior with 4.3 release candidate but I will check and let you know. |
I also tried 4.3 release candidate and unfortunately it has not impact. |
Hi @rotty3000 , Unfortunately I don't see this behavior on my machine. I still see slowness. I am testing on window 10 machine though. I tried it on Ubuntu on virtual box and I didn't see any improvements. Below is the recording captured by me for the same workspace Below are the specs Please let me know details on how and what to debug. I can provide you details which might be helpful. |
hello @prafullp In recent versions of Eclipse there is a UI responsiveness monitoring feature. You can enable it, and Eclipse will automatically take dumps for you to show who is hogging the UI thread. (see screenshots) And UI Freezes will be show in the error log (Window > Show View > Other > Error Log) If this is not available for you in the Error log, you can take your own thread dumps. When you see the slowness (while the editor is waiting to come up), can you take some thread dumps (try to take several) of the java process? It appears that some task is running on the main SWT/UI thread and it is doing some long work (accessing network perhaps or lots of IO?) and that is causing the slowness. Once we have the thread dumps we will know who is hogging the UI thread. |
Hi @gamerson , Was bit busy, so couldn't revert back. I took some random thread dump samples and I have attached them here. Below is the error log from Eclipse after enabling UI responsiveness monitoring The other thing I noticed is that today the time it took was only around 18 seconds to open the file. I will look into the details of what has changed since my last test. |
Thanks @prafullp These thread dumps show exactly where work is being done on the UI thread. The stacktrace below is on the main thread (SWT thread)
|
I'm testing a small change to offload the initialization of the implicit repo from the UI thread. Ideally I'll send a PR and ask that you build bndtools and install the result to verify because I couldn't reproduce the UI blocking to the degree that was encountered. |
@prafullp can you try to build the fix and give feedback. |
@prafullp I've merged this so shortly you should be able to try the snapshot available here: https://bndtools.jfrog.io/bndtools/update |
Hi @rotty3000 , Below is the bnd version installed. Bndtools https://bndtools.org/ bndtools.core 4.4.0.DEV-201910011729-gc6821c1 bndtools.main.feature |
So a colleague of mine noted that your ui_freeze.log lines don't match up with those at 4.4.0.DEV-201910011729-gc6821c1 (gc6821c1 being the git sha where that snapshot was built). Could you follow these steps:
|
I would suggest you make a new, fresh Eclipse installation and install Bndtools into that. |
Hi @rotty3000 , @bjhargrave I downloaded eclipse 2019-09. I couldn't see the stacktrace that I used to see but the time it takes to open the file is still 17 seconds. Please find below latest logs and screenshots Bndtools https://bndtools.org/ bndtools.core 4.4.0.DEV-201910071628-g94c8da7 bndtools.main.feature |
hey @prafullp I don't see any UI thread in your latest ui_freeze. So it seems something else is causing the hang. |
…ners fixes bndtools#3415 Signed-off-by: Raymond Augé <raymond.auge@liferay.com>
fixes #3415 Signed-off-by: Raymond Augé <raymond.auge@liferay.com> Signed-off-by: BJ Hargrave <bj@bjhargrave.com>
…ners fixes #3415 Signed-off-by: Raymond Augé <raymond.auge@liferay.com> Signed-off-by: BJ Hargrave <bj@bjhargrave.com>
I am using bnd 4.2.0 version
I am building OSGI based application and I am using Eclipse IDE for development. My project is maven based and I am using bnd maven plugins for creating bundles and I use bnd tools eclipse plugin to manage bndrun files in eclipse. Opening bndrun files in Eclipse and even building and debugging application is extremely slow.
I did some investigation in bnd plugin code and found that in class
DefaultRunProvider.java
line number 25, the Workspace object is never resolved as
project.hasNature(BndtoolsConstants.NATURE_ID)
is always false. So everytime a for example a bndrun file is opened, it creates a new Workspace Object. AS the code proceeds further, in
is found as null and because of that MavenImplicitProjectRepository is newly initialized and whole process of resolution is done every time. At the end of resolution the MavenImplicitProjectRepository object is added to plugin registry but after closing the bndrun file and opening it again, the whole information is lost and the same set of initializations happens again and again. This takes a lot of time in opening the bndrun file.
For a workspace with around 30 projects, it takes around 20-30 seconds to open the file.
The same behavior is observed when debugger is launched. It takes similar amount of time to get the debugger point to the file where debug point is set.
This behavior is only for visible when maven based project is configured. Its not observed if the project is bnd workspace.
The issue of slow opening of bndrun file can be replicated using following sample project https://github.com/prafullp/maven-bnd-issue.git
Need guidance if I have configured the project wrongly or something is missing.
The text was updated successfully, but these errors were encountered: