From 19b926e5c905acc5beb3738a5668f9705ea79cf9 Mon Sep 17 00:00:00 2001 From: wisberg Date: Thu, 2 Feb 2006 23:35:16 +0000 Subject: [PATCH] more detail in memory answers, on incremental mode and strong static reference to singleton aspects --- docs/faq/faq.xml | 22 +++++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) diff --git a/docs/faq/faq.xml b/docs/faq/faq.xml index 5162ec343..8001b6a0f 100644 --- a/docs/faq/faq.xml +++ b/docs/faq/faq.xml @@ -22,7 +22,7 @@ 2003-2006 Contributors. All rights reserved. - Last updated January 22, 2006 + Last updated February 2, 2006 For a list of recently-updated FAQ entries, see @@ -3156,6 +3156,10 @@ aspect A { When running under an IDE, look to the documentation for the IDE to determine how to increase available memory. + In either case, doing incremental compilations can hold on to + more memory than a one-shot compile process, as the compiler + trades space for time in recompiles. + @@ -3728,12 +3732,14 @@ aspect A { When running classes produced by the AspectJ weaver or compiler, there are no significant hidden uses of memory. As would be expected, each aspect is instantiated. The per-object aspects (like - pertarget or perthis) also + pertarget or perthis) + in some implementations use a map to link aspects and the associated object. When using cflow-related pointcuts, a ThreadLocal is used to track control flow for each affected thread. Of course, the size and code in an aspect can require memory. + Aside from normal Java practices, take care with join point references. When referencing the static part of a join point (e.g., thisJoinPointStaticPart), only one object is created. However, if you reference the join point itself @@ -3741,6 +3747,15 @@ aspect A { JoinPoint object will be created for each join point running advice. + Aspect instances will be garbage collected just like regular objects + after there are no more strong references to them. For the default + aspect instantiation model, issingleton, the aspect + class retains a reference to the singleton instance, in order to + implement static {AspectClass} aspectOf(), so + singleton instances will not be garbage collected until the class is. + For long-running or memory-critical programs, consider using weak + references in singleton aspects for state that should be garbage collected. + Finally, when using load-time weaving, the weaver can require memory in its own right. Because the class loader never can know when it is done loading classes, the weaver can hold on @@ -5028,8 +5043,9 @@ aspectj.doc.dir=C:/eclipse/aspectj-workspace/aj-build/dist/ide/eclipse/org.aspec Entries changed recently: - + + -- 2.39.5