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.
We just did a measurement of the classes loaded by various kits and to our surprise there is quite a lot of them originating from CND. Given the fact that most of the users of the full IDE build do use other features more often than they use CND, these classes are just laying around occupying permanent space desirably needed for other functionality. I'd like the amount of them to be lowered, preferably to zero: org.netbeans.modules.cnd.modelimpl.csm.core.ModelImpl org.netbeans.modules.cnd.api.compilers.CompilerSetManager org.netbeans.modules.cnd.api.model.CsmModel org.netbeans.modules.cnd.api.model.CsmModelAccessor org.netbeans.modules.cnd.api.model.CsmModelAccessor$CsmModelEx org.netbeans.modules.cnd.api.model.CsmModelAccessor$1 org.netbeans.modules.cnd.api.model.CsmModelListener org.netbeans.modules.cnd.api.model.CsmModelState org.netbeans.modules.cnd.api.model.CsmModelStateListener org.netbeans.modules.cnd.api.model.CsmProgressListener org.netbeans.modules.cnd.api.model.util.WeakList org.netbeans.modules.cnd.api.project.NativeProjectItemsListener org.netbeans.modules.cnd.apt.debug.APTTraceFlags org.netbeans.modules.cnd.apt.debug.DebugUtils org.netbeans.modules.cnd.apt.impl.support.APTDriverImpl org.netbeans.modules.cnd.apt.support.APTDriver org.netbeans.modules.cnd.apt.support.APTIncludePathStorage org.netbeans.modules.cnd.apt.support.APTSystemStorage org.netbeans.modules.cnd.apt.utils.APTIncludeUtils org.netbeans.modules.cnd.apt.utils.APTStringManager org.netbeans.modules.cnd.apt.utils.APTStringManager$APTCompoundStringManager org.netbeans.modules.cnd.apt.utils.APTStringManager$APTSingleStringManager org.netbeans.modules.cnd.apt.utils.FilePathCache org.netbeans.modules.cnd.apt.utils.TextCache org.netbeans.modules.cnd.apt.utils.WeakSharedSet org.netbeans.modules.cnd.apt.utils.WeakSharedSet$SharedKeyWeakHashMap org.netbeans.modules.cnd.apt.utils.WeakSharedSet$SharedKeyWeakHashMap$Entry org.netbeans.modules.cnd.apt.utils.WeakSharedSet$SharedKeyWeakHashMap$KeySet org.netbeans.modules.cnd.classview.actions.SelectInClassesAction org.netbeans.modules.cnd.classview.actions.ShowHideClassViewAction org.netbeans.modules.cnd.classview.ClassViewInstaller org.netbeans.modules.cnd.classview.ClassViewInstaller$ProjectListener org.netbeans.modules.cnd.classview.resources.I18n org.netbeans.modules.cnd.CndModule org.netbeans.modules.cnd.debugger.gdb.actions.GdbActionHandlerProvider org.netbeans.modules.cnd.debugger.gdb.actions.ToggleBreakpointActionProvider org.netbeans.modules.cnd.debugger.gdb.EditorContext org.netbeans.modules.cnd.debugger.gdb.EditorContextBridge org.netbeans.modules.cnd.debugger.gdb.EditorContextImpl org.netbeans.modules.cnd.debugger.gdb.EditorContextImpl$EditorLookupListener org.netbeans.modules.cnd.debugger.gdb.GdbDebuggerModule org.netbeans.modules.cnd.debugger.gdb.profiles.ui.ProfileNodeProvider org.netbeans.modules.cnd.debugger.gdb.profiles.ui.ProfileNodeProvider$CndProfileGeneralCustomizerNode org.netbeans.modules.cnd.editor.cplusplus.CCKit org.netbeans.modules.cnd.editor.cplusplus.CCSettingsInitializer org.netbeans.modules.cnd.editor.cplusplus.CKit org.netbeans.modules.cnd.editor.fortran.FKit org.netbeans.modules.cnd.editor.fortran.FSettingsInitializer org.netbeans.modules.cnd.editor.makefile.MakefileKit org.netbeans.modules.cnd.editor.makefile.MakefileSettingsInitializer org.netbeans.modules.cnd.editor.shell.ShellKit org.netbeans.modules.cnd.editor.shell.ShellSettingsInitializer org.netbeans.modules.cnd.gotodeclaration.element.providers.BaseProvider org.netbeans.modules.cnd.gotodeclaration.element.providers.FuncVarElementProvider org.netbeans.modules.cnd.gotodeclaration.element.providers.MacroProvider org.netbeans.modules.cnd.gotodeclaration.element.spi.ElementProvider org.netbeans.modules.cnd.gotodeclaration.element.ui.GoToElementAction org.netbeans.modules.cnd.gotodeclaration.element.ui.GoToElementPanel$ContentProvider org.netbeans.modules.cnd.gotodeclaration.type.CppTypeProvider org.netbeans.modules.cnd.highlight.CppHighlightsLayerFactory org.netbeans.modules.cnd.highlight.error.HighlightProvider org.netbeans.modules.cnd.highlight.error.HighlightProvider$1 org.netbeans.modules.cnd.highlight.error.HighlightProvider$2 org.netbeans.modules.cnd.highlight.HighlightInstaller org.netbeans.modules.cnd.loaders.AsmDataLoader org.netbeans.modules.cnd.loaders.CCDataLoader org.netbeans.modules.cnd.loaders.CDataLoader org.netbeans.modules.cnd.loaders.CndAbstractDataLoader org.netbeans.modules.cnd.loaders.CndMIMEResolver org.netbeans.modules.cnd.loaders.CndSniffyMIMEResolver org.netbeans.modules.cnd.loaders.ExeLoader org.netbeans.modules.cnd.loaders.FortranDataLoader org.netbeans.modules.cnd.loaders.HDataLoader org.netbeans.modules.cnd.loaders.MakefileDataLoader org.netbeans.modules.cnd.loaders.ShellDataLoader org.netbeans.modules.cnd.makeproject.api.actions.BatchBuildAction org.netbeans.modules.cnd.makeproject.api.configurations.ui.CustomizerNode org.netbeans.modules.cnd.makeproject.api.configurations.ui.CustomizerRootNodeProvider org.netbeans.modules.cnd.makeproject.api.CustomProjectActionHandlerProvider org.netbeans.modules.cnd.makeproject.api.DefaultProjectActionHandler org.netbeans.modules.cnd.makeproject.MakeProjectModule org.netbeans.modules.cnd.makeproject.MakeProjectModule$L org.netbeans.modules.cnd.makeproject.runprofiles.RunProfileNodeProvider org.netbeans.modules.cnd.makeproject.runprofiles.RunProfileNodeProvider$RunProfileCustomizerNode org.netbeans.modules.cnd.modelimpl.csm.core.ModelImpl org.netbeans.modules.cnd.modelimpl.csm.core.ModelImpl$3 org.netbeans.modules.cnd.modelimpl.csm.core.ParserQueue org.netbeans.modules.cnd.modelimpl.csm.core.ParserQueue$Queue org.netbeans.modules.cnd.modelimpl.csm.core.ParserQueue$State org.netbeans.modules.cnd.modelimpl.csm.core.ParserThread org.netbeans.modules.cnd.modelimpl.csm.core.ParserThreadManager org.netbeans.modules.cnd.modelimpl.csm.core.ParserThreadManager$Wrapper org.netbeans.modules.cnd.modelimpl.csm.core.ProgressSupport org.netbeans.modules.cnd.modelimpl.debug.TraceFlags org.netbeans.modules.cnd.modelimpl.Installer org.netbeans.modules.cnd.modelimpl.Installer$Startupable org.netbeans.modules.cnd.modelimpl.memory.LowMemoryListener org.netbeans.modules.cnd.modelimpl.platform.ModelSupport org.netbeans.modules.cnd.modelimpl.platform.ModelSupport$FileChangeListener org.netbeans.modules.cnd.modelimpl.platform.ModelSupport$1 org.netbeans.modules.cnd.modelimpl.platform.ModelSupport$1$1 org.netbeans.modules.cnd.modelimpl.platform.ModelSupport$3 org.netbeans.modules.cnd.modelimpl.platform.ProgressListenerImpl org.netbeans.modules.cnd.modelimpl.repository.RepositoryListenerImpl org.netbeans.modules.cnd.modelimpl.repository.RepositoryListenerImpl$RepositoryShutdownHook org.netbeans.modules.cnd.modelimpl.repository.RepositoryUtils org.netbeans.modules.cnd.modelimpl.textcache.FileNameCache org.netbeans.modules.cnd.modelimpl.textcache.ProjectNameCache org.netbeans.modules.cnd.modelimpl.textcache.QualifiedNameCache org.netbeans.modules.cnd.modelimpl.uid.UIDManager org.netbeans.modules.cnd.navigation.hierarchy.HierarchyAction org.netbeans.modules.cnd.repository.api.Repository org.netbeans.modules.cnd.repository.api.RepositoryAccessor org.netbeans.modules.cnd.repository.api.RepositoryTranslation org.netbeans.modules.cnd.repository.disk.AbstractDiskRepository org.netbeans.modules.cnd.repository.disk.DiskRepositoryManager org.netbeans.modules.cnd.repository.disk.DiskRepositoryManager$AllFilter org.netbeans.modules.cnd.repository.disk.DiskRepositoryManager$CloseVisitor org.netbeans.modules.cnd.repository.disk.DiskRepositoryManager$RemovedPersistent org.netbeans.modules.cnd.repository.disk.DiskRepositoryManager$Visitor org.netbeans.modules.cnd.repository.impl.DelegateRepository org.netbeans.modules.cnd.repository.impl.HybridRepository org.netbeans.modules.cnd.repository.queue.BaseQueue org.netbeans.modules.cnd.repository.queue.BaseQueue$Queue org.netbeans.modules.cnd.repository.queue.KeyValueQueue org.netbeans.modules.cnd.repository.queue.RepositoryQueue org.netbeans.modules.cnd.repository.queue.RepositoryQueue$Filter org.netbeans.modules.cnd.repository.queue.RepositoryThreadManager org.netbeans.modules.cnd.repository.queue.RepositoryThreadManager$Wrapper org.netbeans.modules.cnd.repository.queue.RepositoryWriter org.netbeans.modules.cnd.repository.queue.RepositoryWritingThread org.netbeans.modules.cnd.repository.queue.TickingRepositoryQueue org.netbeans.modules.cnd.repository.spi.Persistent org.netbeans.modules.cnd.repository.spi.RepositoryListener org.netbeans.modules.cnd.repository.testbench.Stats org.netbeans.modules.cnd.repository.translator.RepositoryTranslatorImpl org.netbeans.modules.cnd.repository.translator.RepositoryTranslatorImpl$UnitsCache org.netbeans.modules.cnd.repository.util.IntToStringCache org.netbeans.modules.cnd.repository.util.RepositoryListenersManager
Got rid of: org.netbeans.modules.cnd.makeproject.api.configurations.ui.CustomizerNode org.netbeans.modules.cnd.makeproject.api.configurations.ui.CustomizerRootNodeProvider org.netbeans.modules.cnd.makeproject.api.CustomProjectActionHandlerProvider org.netbeans.modules.cnd.makeproject.api.DefaultProjectActionHandler org.netbeans.modules.cnd.makeproject.runprofiles.RunProfileNodeProvider org.netbeans.modules.cnd.makeproject.runprofiles.RunProfileNodeProvider$RunProfileCustomizerNode Still working on: org.netbeans.modules.cnd.makeproject.MakeProjectModule$L org.netbeans.modules.cnd.makeproject.api.actions.BatchBuildAction I think I need org.netbeans.modules.cnd.makeproject.MakeProjectModule so I will keep it for now.
Gor rid of: org.netbeans.modules.cnd.makeproject.MakeProjectModule$L Left is (in project module): org.netbeans.modules.cnd.makeproject.api.actions.BatchBuildAction org.netbeans.modules.cnd.makeproject.MakeProjectModule which we need.
Created attachment 56721 [details] My attempt to remove the need for ModuleInstalls
Thanks for looking at the problem. I tried it myself too, but without proper guidance I can just prototype - not create the right fix. Anyway please look at my patch, I think that at least the CsmLifecycleListener is an interesting concept. If you can identify "entry points" to your code, then you can modify them to trigger the initialization of the listeners when needed, not on start up. This should be win-win situation - as you do not need to change your code that much (ModuleInstall.restored just becomes CsmLifecycleListener.startup) and moreover users not needing the CND functionality will not pay any/much unneeded penalty on start up.
I've made a separate issue for gdb and made this issue depend on it.
How to re-generate the list of loaded classes? I guess you start the IDE with no projects loaded and then what?
To regenerate the classes: Part of my diff attached here is modification of blacklist.txt and some xtest file enabling the xtest to track the classes. Feel free to apply it and even integrate blacklist.txt with classes that you remove. That way we will make sure your fixes do not regress in future. There is other way to generate the list: Start netbeans with -J-verbose:class
got rid of: org.netbeans.modules.cnd.makeproject.MakeProjectModule
Reduced number of classes related to language model by 76 (see details in the attachment)
Created attachment 57636 [details] Reducing language model classes by 76: details
The number of CND classes loaded at startup is reduced more than twice. A lot of class loads can't be eliminated (data loaders, global actions, classes that are responsible for activating the model when CND projects are loaded, etc) Nevertheless there still is a room for improvement. Therefore I'm not closing the issue, but just downgrading it to P3.
data loaders were eliminated as well I think, now we have only necessary classes to be loaded
Alexander, can you please update the whitelist and count the number of classes that come from CND? Just doing $ grep cnd ~/src/netbeans/fixes/ide.kit/test/qa-functional/data/whitelist.txt | wc -l still yields 144, which seems a bit too much to be true (at least I hope).
List of loaded classes of last whitelist test run on Windows XP (080825) has 60 cnd classes. Should I remove other 84 cnd classes from whitelist?
Created attachment 68854 [details] CND classes in 080825 build
Yes, Alexander, please remove the classes which are no longer loaded from whitelist. Anyway, I think there is still plenty of room for improvement. I see no reason to load anything that relates to model until at least one C/C++ project is created. Please continue in your fixing effort.
thanks for the list (I'm changing summary). We will investigate it later
Does this mean that 10 classes are useful? ;-)
I think, yes :-) We need some infrastructure to be registered to track start of C++ activity
Jaroslav, Is it still a valid issue?
fixed