This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 48226 - [perf] IDE shutdown can take ages due to MDR B-tree persisting and is unresponsive
Summary: [perf] IDE shutdown can take ages due to MDR B-tree persisting and is unrespo...
Status: CLOSED FIXED
Alias: None
Product: java
Classification: Unclassified
Component: Unsupported (show other bugs)
Version: 4.x
Hardware: PC Windows XP
: P2 blocker (vote)
Assignee: Daniel Prusa
URL:
Keywords: PERFORMANCE
Depends on:
Blocks:
 
Reported: 2004-08-31 12:56 UTC by Antonin Nebuzelsky
Modified: 2006-03-24 10:35 UTC (History)
2 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
Stack trace of AWT where you can see the calls in MDR which are currently NOT covered by the progress and should be covered (2.99 KB, text/plain)
2004-09-08 10:00 UTC, Antonin Nebuzelsky
Details
Simple project for measuring sync() routine (6.12 KB, application/octet-stream)
2004-09-09 14:16 UTC, Pavel Flaska
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Antonin Nebuzelsky 2004-08-31 12:56:23 UTC
If new sources/libraries have been parsed during
the IDE run, IDE shutdown can take very long (tens
of seconds or even a minute). AWT thread is
blocked during that time in MdrStorage.shutDown()
method, calling btreestorage.LogFile.flushFile()
for all the B-trees.

This confuses the user, who does not expect the
shutdown to take so long, and what is even worse
is that the user may kill the IDE during this
process which would corrupt the MDR storage and
full scan would be started next time (I guess).

In short, progress bar with progress indication
(and the flushing process running on background)
is needed.

The progress dialog could say for example "Writing
project classpath information to persistent
storage." with the dialog title "IDE shutdown".
Comment 1 Martin Matula 2004-08-31 13:07:27 UTC
Dusane, any comments?
Comment 2 dpavlica 2004-08-31 14:24:20 UTC
I agree in that case when it can take more then 6-10 seconds. Then 
there should exist Progress indication...suggested labels looks quite 
good and Propgress in dialog should look similar to Progress in 
Scanning dialog in the spec.
Comment 3 Martin Matula 2004-09-02 12:41:37 UTC
Honzo, please add the progress bar. Thanks.
Comment 4 Jan Becicka 2004-09-07 11:15:28 UTC
I'm afraid we are unable to fix this issue without openide help.
As you mentioned before, mdr stuff is saved on IDE shutdown. IDE
shutdown is done in AWT thread. It looks like the only way, how to
prevent the IDE from doing System.exit() is to block whole process in
ModuleInstall.close().

Any ideas how to implement shut down progress? Please help as soon as
possible. It is P2. Thanks.




Comment 5 Jan Becicka 2004-09-07 14:26:06 UTC
"Textual" version of progressbar commited to trunk:
Checking in ClassIndex.java;
/cvs/java/javacore/src/org/netbeans/modules/javacore/ClassIndex.java,v
 <--  ClassIndex.java
new revision: 1.15; previous revision: 1.14
done
Checking in Bundle.properties;
/cvs/java/javacore/src/org/netbeans/modules/javacore/Bundle.properties,v
 <--  Bundle.properties
new revision: 1.10; previous revision: 1.9
done
Comment 6 Jan Becicka 2004-09-07 15:57:05 UTC
OK, I have it! I'll commit it as soon as commit validation pass.
Thanks to Jarda for his help.
Comment 7 Jan Becicka 2004-09-07 16:25:51 UTC
Implemented. Tondo, please verify.

Checking in ShutDownProgressPanel.java;
/cvs/java/javacore/src/org/netbeans/modules/javacore/ShutDownProgressPanel.java,v
 <--  ShutDownProgressPanel.java
initial revision: 1.1
done
RCS file:
/cvs/java/javacore/src/org/netbeans/modules/javacore/ShutDownProgressPanel.form,v
done
Checking in ShutDownProgressPanel.form;
/cvs/java/javacore/src/org/netbeans/modules/javacore/ShutDownProgressPanel.form,v
 <--  ShutDownProgressPanel.form
initial revision: 1.1
done
RCS file:
/cvs/java/javacore/src/org/netbeans/modules/javacore/ShutDownProgressListener.java,v
done
Checking in ShutDownProgressListener.java;
/cvs/java/javacore/src/org/netbeans/modules/javacore/ShutDownProgressListener.java,v
 <--  ShutDownProgressListener.java
initial revision: 1.1
done
Checking in JavaCoreModule.java;
/cvs/java/javacore/src/org/netbeans/modules/javacore/JavaCoreModule.java,v
 <--  JavaCoreModule.java
new revision: 1.7; previous revision: 1.6
done
Checking in ClassIndex.java;
/cvs/java/javacore/src/org/netbeans/modules/javacore/ClassIndex.java,v
 <--  ClassIndex.java
new revision: 1.16; previous revision: 1.15
done



Comment 8 Antonin Nebuzelsky 2004-09-08 08:49:00 UTC
The progress dialog is displayed at the shutdown, but too late and for
too short amount of time.

After invoking the shutdown, main window is gray and in console thread
dump I can see that MdrStorage.shutDown() is being executed but the
progress dialog is not yet displayed. Then the main window disappears
and the progress dialog appears for a short moment.

This must be changed to cover the whole MDR shutdown with the progress.
Comment 9 Jan Becicka 2004-09-08 09:00:41 UTC
Ha - in that case it is performance problem in MDR. Progress Bar shows
progress of saving ClassIndexes - it can last long. Rest of MDR stuff
should be saved fast. If it is not true, it must be fixed.
Dan will take a look at it.
Comment 10 Antonin Nebuzelsky 2004-09-08 10:00:28 UTC
Created attachment 17469 [details]
Stack trace of AWT where you can see the calls in MDR which are currently NOT covered by the progress and should be covered
Comment 11 Tomas Hurka 2004-09-08 17:00:15 UTC
Please provide more information how to reproduce it. I cannot see it on Mac OS X nor 
Linux.
Comment 12 Jan Becicka 2004-09-09 09:42:36 UTC
This issue is Windows specific. We should not add any progress bar,
but rather find out, why the shutdown takes so long on Windows.
Tondo, can you help us with that?
Comment 13 Pavel Flaska 2004-09-09 14:11:35 UTC
FileDescriptor.sync() method is roughly 10 times slower on Windows
than on Linux.
Comment 14 Pavel Flaska 2004-09-09 14:16:38 UTC
Created attachment 17516 [details]
Simple project for measuring sync() routine
Comment 15 Antonin Nebuzelsky 2004-09-09 14:29:18 UTC
> We should not add any progress bar, but rather find out, why
> the shutdown takes so long on Windows.

Let me disagree. I saw the shutdown take very long time, spent in the
methods mentioned in this issue, also on my Linux notebook.

So, yes, make it faster on Windows. But still, cover the shutdown with
the progress bar.
Comment 16 Pavel Flaska 2004-09-09 14:52:04 UTC
Bear in mind that there is a difference between first shutdown (ide is
running with fresh new userdir) and other ones.
Comment 17 Daniel Prusa 2004-09-09 16:35:22 UTC
Prograss bar moved from javacore to mdr module.

Checking in org/netbeans/modules/mdr/MdrModule.java;
/cvs/mdr/module/src/org/netbeans/modules/mdr/MdrModule.java,v  <-- 
MdrModule.java
new revision: 1.2; previous revision: 1.1
Comment 18 Antonin Nebuzelsky 2004-09-10 13:21:32 UTC
Verified in trunk.
Marking as a candidate for merge to release40_beta2 branch.
Comment 19 Antonin Nebuzelsky 2004-09-16 09:51:27 UTC
Verified in Beta 2 build 200409160517.