Closed dtrunk90 closed 10 years ago
There seems to be a leak in less4j processor. Could you report this issue on less4j github project page?
Thanks, Alex
It looks like flags suggested in this stackoverflow answer solved the problem. They allow tomcat to better manage available PermGen.
Background: PermGen is part of memory used to store class loaders, java classes metadata and so on. It runs out of space when less4j tries to create lexer, but that does not necessary means that less4j is the cause. Links to more detailed explanations:
Something is loading and keeping a lot of classes, and it may or may not be less4j. I think it is not less4j, but I can not fully exclude that possibility yet.
Though I'm not sure this is the cause, the less4j processor creates a new instance of less4j compiler for each processing because less4j is not thread safe. If creating an instance of less4j is an expensive operation, I could use a pool to reuse already created instances. Before doing that, I would like to be able to reproduce the issue. A quickstart project or any relevant configuration details woul be helpful.
@alexo PermGen does not store instances, it stores class definitions and class loaders. From what I read last two days, it should run out of memory in these cases:
Creating another instance of the same class again should not take more of its space, so I do not think reusal of instances would help much. Leaks happen when you deploy and undeploy repeatedly. He configured huge perm gen space (2048m), so class loaders dependency issue is probable.
An example project with all dependencies that cause the issue would help to find responsible class or lib. I do not see how it could be possible to find the leak otherwise.
@dtrunk90 have you managed to reproduce this issue with the latest version of less4j ?
Not tested, I'm using lessCss.less preprocessor now.
I'm closing this issue, since it is related to less4j and probably was fixed in one of the latest version of less4j.
In development (local machine) I've created my project and directly after mvn clean tomcat7:run the webapp initializes. Then on first request some work is done by wro4j and I'm getting the out of memory exception.
I'm running Ubuntu 13.04 and my /etc/defaults/tomcat7 contains the following JAVA_OPTS:
This is my wro4j config:
With a custom model factory provider registered in
META-INF/ro.isdc.model.spi.ModelFactoryProvider
:and a custom xml model factory to load wro.xml directly from classpath:
Configured my webapp without xml (Java Config):
I'll set up an example project later and try to reproduce this. But maybe you can take a look at this stacktrace in the meanwhile: