Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [aspectj-users] problems with load time weaving and rmi communication


Thilo,

Can I ask some questions:
1. What is the memory usage when you use RMI but not the aspect?
2. Which version of AspectJ are you using? We have made some enhancements recently in memory usage.
3. Do you use -verbose in the weaver options of aop.xml? If so could you post it. I think the problem might to do with creating lots of class loaders, each with a weaver and the accompanying footprint.

Cheers

Matthew Webster
AOSD Project
Java Technology Centre, MP146
IBM Hursley Park, Winchester,  SO21 2JN, England
Telephone: +44 196 2816139 (external) 246139 (internal)
Email: Matthew Webster/UK/IBM @ IBMGB, matthew_webster@xxxxxxxxxx

http://w3.hursley.ibm.com/~websterm/

Please respond to aspectj-users@xxxxxxxxxxx

Sent by:        aspectj-users-bounces@xxxxxxxxxxx

To:        aspectj-users@xxxxxxxxxxx
cc:        
Subject:        [aspectj-users] problems with load time weaving and rmi        communication


Hello,

i wrote an aspect, that collects performance data for every public
method in my webapplication that has a special annotation. The
corresponding pointcut looks like this:

   pointcut probeMethod(Object object): execution(@MyAnnotation *
*.*(..)) && this(object);

i integrated the aspect in my tomcat container and activated load time
weaving (-javaagent:aspectweaver.jar).
then i wrote a simple servlet that has a public method with this
annotation (the method just waits a short time via Thread.sleep()) and
tested it with a little stress test (jwebunit test), that permanently
called the servlet request. Simultaneously i observed my servlet
container (tomcat) via jconsole (heap memory usage, loaded classes). the
memory usage was constant while the test was running and the aspect
worked fine.

now i extended my annotated method with rmi communication, like the
following:

       Properties prop = new Properties();
       prop.put("java.naming.factory.initial",
"weblogic.jndi.WLInitialContextFactory");
       prop.put("java.naming.provider.url", "t3://MyIP");
       InitialContext ctx = new InitialContext(prop);
       Object objref = ctx.lookup("MyBean");
       MyServiceHome beanHome = (MyServiceHome)
javax.rmi.PortableRemoteObject.narrow(objref, MyServiceHome.class);
       MyService myService = beanHome.create();
       myService.doSomething();

Now i started my stress test again. The Aspect again worked fine but i
amazed about the memory usage: While running the test the heap memory
usage increased permanently (up to 1 GByte!!). Additionally i noticed
that classes where loaded permanently (noticed this with jconsole).

This phenomenon does only occur when i add bean communication via rmi.
without that, everything works fine.

does anyone has an explanation for this? i assume the load time weaving
mechanism has problems with rmi communication, but i don't know why...

greetings,
thilo
_______________________________________________
aspectj-users mailing list
aspectj-users@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/aspectj-users


Back to the top