Richard V. wrote:
Hi XWiki users,
I have encountered a problem where after running XWiki on my tomcat server for a week, i
get an java.lang.OutOfMemoryError: PermGen space error. It appears that xwiki consumed all
the java heap space. I believe the problem may be related to unreleased DB connections
because, I noticed that everytime I try to shutdown tomcat, it hangs with xwiki deployed,
also by running "ps aux" i see the postgresql connection processes belonging to
xwiki still running. I tried deploying another application that uses hibernate +
postgresql on the same tomcat running xwiki, and upon shutting down the server, all db
connection processes from the other application gracefully terminate but not the ones from
xwiki.
My question is does anyone ever had this problem before? If so what is the solution?
Solutions that I have tried but did NOT work:
1- Increase java heap with -Xmx512m
2- Reduce the maximum and minimum idle DB connections
My system specs:
OS: Linux ubuntu kernel 2.6.20
Java: 1.6.0_05-13
Xwiki: 1.4 (binary distribution)
Posgresql: 8.2.6
Total RAM: 1Gb
AFAIK, there isn't a leak, but a somewhat "normal" behavior caused by
the cache settings. The cache is configured to be a fixed size LRU
cache, so if you store large entries in the cache, they will be kept
there. The OOM error appears mostly when there are large attachments in
the database. You should either reduce the size of the attachment cache
or increase the memory.
The shutdown problem is a different thing, it doesn't have anything to
do with the database connections. I think it is because of some threads
we're spawning that don't receive the shutdown message (the quartz
scheduler for example). A memory leak regarding DB connections would
mean there are thousands of open connections to the database, but I am
pretty sure that's not the case, right?
So, the main question is: Are there many & pretty large attachments in
the wiki?
--
Sergiu Dumitriu
http://purl.org/net/sergiu/