Summary: | Reduce footprint of JoinPoint.StaticPart objects | ||||||||
---|---|---|---|---|---|---|---|---|---|
Product: | [Tools] AspectJ | Reporter: | Matthew Webster <matthew_webster> | ||||||
Component: | Compiler | Assignee: | Adrian Colyer <adrian.colyer> | ||||||
Status: | RESOLVED FIXED | QA Contact: | |||||||
Severity: | enhancement | ||||||||
Priority: | P3 | CC: | noelmark | ||||||
Version: | 1.2.1 | ||||||||
Target Milestone: | 1.5.0 M4 | ||||||||
Hardware: | PC | ||||||||
OS: | Windows XP | ||||||||
Whiteboard: | |||||||||
Attachments: |
|
Description
Matthew Webster
2004-04-19 10:52:41 EDT
Adding Noel CC Created attachment 10392 [details]
Patch to implement option (1)
I am appending the attachment from Noel Markham that implements option (1) of
the two strategies proposed for addressing this problem.
Noel says:
---
Please find attached two patches: LazyClassGen.java and Factory.java, for
reducing the footprint of JoinPoint.StaticPart objects. Currently, only the
methods makeMethodSig() and makeCatchClauseSig() in Factory.java take a
broken-up set of parameters.
Since the generated code is enclosed in a static block, it is only run once and
shoudn't affect the performance too much. Using my FFDC Simulation tests, the
free heap size (on a 4Meg heap) has been increased from ~600k to ~1.6M.
On the test, 1000 classes are produced, each with four catch blocks. The class
names(fully qualified with package name) are approx 60 chars, and the method
names are approx 40 chars.
----
My only concern with the approach is using makeClass() which calls
Class.forName() - I wonder if that is necessary - but I haven't become an
expert on this area of code like Noel has so I can't say yet !
Created attachment 10445 [details]
New version of patch to implement (1)
This patch creates overriding methods for makeMethodSig(),
makeConstructorSig(), makeFieldSig(), makeAdviceSig(), makeInitializerSig() and
makeCatchClauseSig() in Factory.java The code to use these methods instead of
the one-String parameter methods is in the second file, a patch for
LazyClassGen.java
This patch supersedes the previous submission.
This could reduce memory usage in AJ programs and it is worth looking at integrating this patch in AJ5 M4. Note that tjpsp currently provides a stable and unique hashCode for use in Maps etc.. Any change to the implementation must preserve this property. patch updated and applied. |