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 21258 - 100% CPU usage for several minutes
Summary: 100% CPU usage for several minutes
Status: VERIFIED WONTFIX
Alias: None
Product: platform
Classification: Unclassified
Component: Filesystems (show other bugs)
Version: 3.x
Hardware: Sun SunOS
: P3 blocker (vote)
Assignee: Petr Nejedly
URL:
Keywords: PERFORMANCE
Depends on:
Blocks:
 
Reported: 2002-03-06 16:10 UTC by Jan Zajicek
Modified: 2008-12-23 11:45 UTC (History)
5 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
bunch of ftds (41.14 KB, text/plain)
2002-03-06 16:11 UTC, Jan Zajicek
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Jan Zajicek 2002-03-06 16:10:31 UTC
FFJ40EE-EA #020301_1
jdk1.4.0, Solaris 5.8
window configuration MDI

Probably ireproducible.

Just changed root node of some localfilesystem and then tried to expand it. CPU
jumps to 100% for cca 5 minutes. Severeal thread dumps are attached. (Note, the
file system structure was small). After this ide looks ok again. Filing this
only because if someone will check the stacktraces. This happens me several
times in the past.
Comment 1 Jan Zajicek 2002-03-06 16:11:23 UTC
Created attachment 4968 [details]
bunch of ftds
Comment 2 _ ttran 2002-03-07 07:36:00 UTC
looks like GC kicks in and WeakListners start to unregister, at the
same time someone else needs those listeners so they are being
re-registered. (rougly speaking)

It reminds me that we actually need time-out weak references not weak
references per se which get GC'ed everytime a full GC cycle is run.

Comment 3 Jesse Glick 2002-03-07 08:45:19 UTC
Agreed, we have a need for something halfway between a weak and soft
ref... should have a configurable timeout, and every call to get()
records the last time this happened. If get() is not called for the
timeout period, the ref is made available for collection during the
next GC cycle as a weak ref.
Comment 4 Petr Nejedly 2002-03-07 10:32:20 UTC
No, Trung, it is not caused by early unregistration of listeners.
It is even not caused by those WeakListeners.

There is a refresh process running in the background, caused by
the root folder change. Honza told me he changed the root
on the deeply expanded $HOME. Because the FS was expanded deeply,
there was a lot of DataObjects crated and they were rerecognized.

To the WeakListener collection: During the rerecognition, MimeSupport,
when consulted, creates a CachedFileObject and hooks it through
WeakListener on the real FileObject to reflect possible changes in
them (a bit of overkill for short-living object, but we can't
really controll its lifetime). These get collected very quickly,
which is right behavoiur.
Moreover, DOs existing in the previous configuration will be
invalidated (the FOs under them won't exist any more) and thus
GCed as well and their listeners get freed too. The unregistration
itself (although visible in the dumps) should not be to costly
unles there is a big folder (see issue 20715), but I can speed
it up for listener sequences of the same kind (I have the code
already prepared, I was working on WL refactoring).

So the problem probably lies in the amount of DOs and especially
DataFolders revalidated. It may be possible that there is some
work done multiple times, but not because of WeakReferences.

Generally, I've proposed implementation of a timed reference
long time ago, but this is probably not the place where we need it.
FOs are weak referenced but the FolderList, once created for them,
is soft cached and so the FOs are effectively softly reachable.
Comment 5 Petr Nejedly 2002-03-11 11:10:16 UTC
BTW: I've streamlined the timed WeakListener unregistration
to be faster, less memory intensive and doing less introspection.
Comment 6 Marek Grummich 2002-07-22 11:14:32 UTC
Set target milestone to TBD
Comment 7 Marek Grummich 2002-07-22 11:17:51 UTC
Set target milestone to TBD
Comment 8 _ pkuzel 2002-12-05 13:48:57 UTC
Unfortunatelly there is missing information if user experienced UI
freeze. 100% CPU load is OK if it does not affect AWT events processing.

I'm able to simulate 100% CPU load that does not affect AWT
processing, but I'm unable to simulate 100% CPU load that
blocks/starves AWT. Unfortunatelly in reality it ocassionaly occures
e.g. while Java parsing thread is active.
Comment 9 Petr Nejedly 2003-01-29 13:55:00 UTC
If there is work that have to be done, nothing can prevent it.
Changing the root of LFS is evil (for other reasons as well),
so closing as wontfix.
Comment 10 Marian Mirilovic 2003-07-25 18:36:54 UTC
Peter is right - verifying.