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 244497 - LocalHistoryStoreImpl.cleanUpFolder does a lot of work at every startup
Summary: LocalHistoryStoreImpl.cleanUpFolder does a lot of work at every startup
Status: RESOLVED FIXED
Alias: None
Product: versioncontrol
Classification: Unclassified
Component: Localhistory (show other bugs)
Version: 8.0.1
Hardware: PC Linux
: P3 normal with 1 vote (vote)
Assignee: Tomas Stupka
URL:
Keywords: PERFORMANCE
Depends on:
Blocks:
 
Reported: 2014-05-14 23:14 UTC by Jesse Glick
Modified: 2014-05-25 01:31 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jesse Glick 2014-05-14 23:14:39 UTC
20140430-6a41887cb2db. Every time I start the IDE, there is heavy disk I/O for several minutes that makes the IDE (and the rest of the computer) mostly unresponsive. Thread dumps show

"LocalHistory.ParallelTasks" daemon prio=10 tid=0x00007f3f98377800 nid=0x5311 runnable [0x00007f3f7a893000]
   java.lang.Thread.State: RUNNABLE
	at java.io.UnixFileSystem.getBooleanAttributes0(Native Method)
	at java.io.UnixFileSystem.getBooleanAttributes(UnixFileSystem.java:242)
	at java.io.File.exists(File.java:813)
	at org.netbeans.modules.localhistory.store.LocalHistoryStoreImpl.cleanUpFolder(LocalHistoryStoreImpl.java:782)
	- locked <0x00000000c102fba0> (a org.netbeans.modules.localhistory.store.LocalHistoryStoreImpl)
	at org.netbeans.modules.localhistory.store.LocalHistoryStoreImpl.cleanUpImpl(LocalHistoryStoreImpl.java:764)
	at org.netbeans.modules.localhistory.store.LocalHistoryStoreImpl.access$1000(LocalHistoryStoreImpl.java:82)
	at org.netbeans.modules.localhistory.store.LocalHistoryStoreImpl$4.run(LocalHistoryStoreImpl.java:733)
	at org.openide.util.RequestProcessor$Task.run(RequestProcessor.java:1423)
	at org.openide.util.RequestProcessor$Processor.run(RequestProcessor.java:2033)

${netbeans.user}/var/filehistory is about 109Mb. If something needs to be cleaned up, could it be done less frequently, or small subsets on each start?
Comment 1 Jesse Glick 2014-05-15 16:06:34 UTC
Would also be appropriate to display a progress indicator with a cancel button (api.progress IIRC) for a heavyweight background task like this.
Comment 2 Jesse Glick 2014-05-20 15:16:45 UTC
Could simply select a randomized subset each time. Would you accept patches?
Comment 3 Tomas Stupka 2014-05-20 15:27:22 UTC
yes, patches are welcome
Comment 4 Tomas Stupka 2014-05-20 15:40:17 UTC
until fixed a possible workaround would be to set "never remove LH files" in options > team > versioning > history
that, of course, might bloat the storage ...
Comment 5 Jesse Glick 2014-05-20 17:02:02 UTC
> "never remove LH files" in options > team > versioning > history

Ah, did not realize there was such an option; will try that for now.
Comment 6 Tomas Stupka 2014-05-23 15:27:20 UTC
to prematurely stop cleanup  set either 
-J-Dnetbeans.localhistory.maxCleanupCount=amount of versioned files 
or 
-J-Dnetbeans.localhistory.maxCleanupTime=time in seconds 

you wrote the problem appears every time. Wandering what generated those 109Mb in case that entries older than a week are removed.
is there anything running in your setup that could touch a big amount of files ? (or very often maybe?)

fixed in core-main #1f793bcff9ff
Comment 7 Quality Engineering 2014-05-25 01:31:09 UTC
Integrated into 'main-silver', will be available in build *201405250001* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)

Changeset: http://hg.netbeans.org/main-silver/rev/1f793bcff9ff
User: Tomas Stupka <tstupka@netbeans.org>
Log: Issue #244497 - LocalHistoryStoreImpl.cleanUpFolder does a lot of work at every startup