Bug 1030452 - Consider removing parsed plugin descriptors after parsing
Consider removing parsed plugin descriptors after parsing
Product: RHQ Project
Classification: Other
Component: Plugin Container, Performance (Show other bugs)
Unspecified Unspecified
unspecified Severity unspecified (vote)
: ---
: RHQ 4.10
Assigned To: Heiko W. Rupp
Mike Foley
Depends On:
Blocks: JON3-2
  Show dependency treegraph
Reported: 2013-11-14 08:32 EST by Heiko W. Rupp
Modified: 2014-04-23 08:30 EDT (History)
2 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2014-04-23 08:30:22 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)
Possible patch (2.88 KB, patch)
2013-12-06 04:03 EST, Heiko W. Rupp
no flags Details | Diff

  None (edit)
Description Heiko W. Rupp 2013-11-14 08:32:48 EST
The PluginMetadataManager keeps a list of plugin parsers and plugin descriptors around even after all the parsing has been done. On my local agent, they account for ~3MB (of a 25MB heap) of objects that are probably no longer needed.
If they are needed at plugin update time, we should be able to just re-parse the needed ones for this purpose.
Comment 1 Heiko W. Rupp 2013-11-14 09:26:20 EST
It looks like some parts are still used later:

	at org.rhq.core.pc.plugin.PluginComponentFactory.getDiscoveryComponent(PluginComponentFactory.java:98)
	at org.rhq.core.pc.inventory.InventoryManager.discoverPlatform(InventoryManager.java:2293)
Comment 2 Heiko W. Rupp 2013-12-06 04:03:05 EST
Created attachment 833476 [details]
Possible patch
Comment 3 John Mazzitelli 2013-12-11 15:56:19 EST
We need to be careful and account for all the places with the descriptor might be needed in the future. As comment #1 indicates, getting classes from the descriptor is usually needed (resource component and discovery component).

The attached patch will work to clean the memory out, but I worry what happens when we need the descriptor later during runtime. Parsing the XML descriptor can be expensive, especially if we do it all them time to get those classnames.
Comment 4 Heiko W. Rupp 2013-12-12 02:53:55 EST
Mazz, Comment 1 was long before I provided the attached patch. Unfortunately BZ does not allow to remove a comment or mark as obsolete.
The class names are stored in (two?) map(s), that are not thrown away by the patch.
Comment 5 Heiko W. Rupp 2014-02-05 04:33:20 EST
master bba7267
Comment 6 Heiko W. Rupp 2014-04-23 08:30:22 EDT
Bulk closing of 4.10 issues.

If an issue is not solved for you, please open a new BZ (or clone the existing one) with a version designator of 4.10.

Note You need to log in before you can comment on or make changes to this bug.