openjpa-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jaeger, Michael" <>
Subject J9 and many MultiClassLoader objects
Date Wed, 03 Dec 2008 16:07:47 GMT

we have an issue in our setup using openjpa 1.1.0 and IBMs J9 2.3
(1.5.0). We do not know whether this belongs to openjpa or IBM's J9.
However, we think that it might be interesting for OpenJPA-ers.

The effect is that after a period of use our system sometime runs out of
memory having a four digit number of MultiClassLoader objects in the
memory. The effect does appear on IBM's J9 only and was not seen on
Sun's JVM.

Our assumtion is that the J9 garbage collector handles ClassLoader
objects (and subclasses) differently and garbages them in longer
intervals than other objects. As a consequence, we have either luck and
the garbage collector wipes those thounsand of objects sometimes or we
run out of memory. The MultiClassLoader seems to be created with every
creation of an EntityManager, what happens a lot of times in one hour in
our application use.

We have solved this problem for our use by applying a patch at the
constructor of the MultiClassLoader, implementing a
singleton-per-persistence-unit-pattern (and adding some
thread-safe-wrappings when removing classloaders). Actually, we do not
see any negative behaviour resulting from re-using existing
MultiClassLoader objects (aka returning an existing/held one instead of
calling the constructor of MultiClassLoader). One question would be, if
it would be possible to reuse MultiClassLoaders instead of creating new
one by default? Has the problem maybe reported elsewhere so we could
another info how to deal with it? (I have tried a search to JIRA or
mailing lists already ...)

kind regards,


View raw message