Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [m2e-dev] Running out of permgen in eclipse

Igor,

At this point, I have two contradictory things to report, and then I
plan to be very quiet on this subject until I am sure that I'm
prepared to make sense.

I was wrong when I thought I'd 'cured' the large permgen requirement
of the CXF command-line build. I fixed one problem, and then ran an
experiment with the wrong command-line that fooled me into thinking
that I had solved the entire problem.

While tracking this down, however, I have observed the following:

1) Helios SR1, at least as packaged for MacOSX, starts with permgen
set up to 256m. This is no surprise -- OSGi means the creation of many
class loaders, potentially with duplicated copies of many classes.

2) Maven all by itself does something similiar: every plugin has a
classloader. A typical maven CXF build examined in yourkit has a very
long list of them -- mostly pretty small.

So, it's not really all that shocking that if you add them together
you might push past the 256m limit. I wonder if maven would be better
off with some 'weak' model of holding those per-plugin loaders, but I
speak from comparative ignorance.

Now, in fact, at this instant, there are (at least) two phenomena
specific to plugins used in the CXF build that make this worse. One
creates proxy classes inside the class loader of the classes being
proxied, so, I think, they are effectively leaked. The other is
related to the JAX-B xsd-to-java mojo, and I haven't really excavated
that one yet.

It may well be that if I can knock these down, that the whole gigantic
thing will happily execute in eclipse in 256m of permgen.



On Sun, Nov 21, 2010 at 9:53 AM, Igor Fedorenko <igor@xxxxxxxxxxxxxx> wrote:
> Does the number of loaded classes grow over time (with each workspace
> build, for example) or it's stays about the same after reaching initial
> high number?
>
> --
> Regards,
> Igor
>
> On 10-11-20 08:53 PM, Benson Margulies wrote:
>>
>> Having fixed the problem that ran out of permgen when building CXF
>> outside of eclipse, I turned back to 'inside of eclipse'.
>>
>> The default Helios install has a max perm gen of 256M. The import
>> succeeds, but subsequent building uses up all that permgen and then
>> things get stuck. There are 36K classes loaded at this point.
>>
>> Looking in more detail, I see that opening a pom for the first time
>> loads (according to yourkit) 3K classes. They are not primarily
>> 'maven' classes. The class loader with most of the maven classes has
>> 746 classes, 445 with no instances. The object graph under
>> MavenProject is very large, but that should mostly be ordinary memory,
>> not permgen.
>>
>> This being eclipse/osgi, there are, of course, many class loaders.
>>
>> It may just be that the maven universe, piled atop the existing
>> multitude of osgi class loaders in eclipse, just needs even more
>> permgen space than plain old eclipse.
>> _______________________________________________
>> m2e-dev mailing list
>> m2e-dev@xxxxxxxxxxx
>> https://dev.eclipse.org/mailman/listinfo/m2e-dev
>
> _______________________________________________
> m2e-dev mailing list
> m2e-dev@xxxxxxxxxxx
> https://dev.eclipse.org/mailman/listinfo/m2e-dev
>


Back to the top