[
Date Prev][
Date Next][
Thread Prev][
Thread Next][
Date Index][
Thread Index]
[
List Home]
[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