Important Notice: Our web hosting provider recently started charging us for additional visits, which was unexpected. In response, we're seeking donations. Depending on the situation, we may explore different monetization options for our Community and Expert Contributors. It's crucial to provide more returns for their expertise and offer more Expert Validated Answers or AI Validated Answers. Learn more about our hosting issue here.

What extra memory is required at runtime?

extra memory runtime
0
Posted

What extra memory is required at runtime?

0

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) 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 (e.g., thisJoinPoint), then one 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 refer

Related Questions

What is your question?

*Sadly, we had to bring back ads too. Hopefully more targeted.

Experts123