cancel
Showing results for 
Search instead for 
Did you mean: 

Out of memory uploading documents

mcd
Champ in-the-making
Champ in-the-making
Hi,

I'm experiencing an 'out of memory' error in an Alfresco Web Service for uploading documents.
The process creates one folder per hour and uploads the documents into them, acording with the time of uploading.
The memory taken by the service increases little by little and after 5 hours running and with about 10.000 documents uploaded, the process reachs the out of memory.
I think I'm having the problem creating the document's node with the following code:


NodeRef nodo = serviceRegistry.getNodeService().createNode(
carpeta,
ContentModel.ASSOC_CONTAINS,
QName.createQName(NamespaceService.CONTENT_MODEL_1_0_URI + datos.getNombre()),
MyModel.TIPO_FACTURA).getChildRef();


When I comment this code and the process is only creating folders, the level of memory consumed remains constant.

I've also tried this, having the same result:


NodeRef contenido = serviceRegistry().getNodeService().createNode(
carpeta,
ContentModel.ASSOC_CONTAINS,
QName.createQName(NamespaceService.CONTENT_MODEL_1_0_URI + nombre),
tipo,
mapProps).getChildRef();


I've used Java VisualVM for profiling, so here are screenshots of the heap dump and the monitoring process.

http://img18.imageshack.us/img18/4165/16886532.png
http://img801.imageshack.us/img801/4509/53486370.png

My environment:
Ubuntu 12.04
Alfresco version: 3.3.5
apache-tomcat-7.0.34 
1GB JVM heap

Any help would be much apreciated.
Thanks in advance.
5 REPLIES 5

mitpatoliya
Star Collaborator
Star Collaborator
Have you checked this link?
http://wiki.alfresco.com/wiki/JVM_Tuning
also you code looks fine there is nothing which could cause the memory leakage.
There might be some other cause.
And also if you monitor the Alfresco classes as well it will be more informative.

mcd
Champ in-the-making
Champ in-the-making
Hi Mits,

These are my JVM settings:

# Server Hotspot VM
JAVA_OPTS="$JAVA_OPTS -server"
# Modelo de datos de x bits -d32/-d64
JAVA_OPTS="$JAVA_OPTS -d64"
# Heap Size - Total old generation
JAVA_OPTS="$JAVA_OPTS -Xms1024m -Xmx1024m"
# Total permanent generation
JAVA_OPTS="$JAVA_OPTS -XX : PermSize=192m"


JAVA_OPTS="$JAVA_OPTS -server -Xss256k -XX :MaxPermSize=256m -XX :NewSize=512m -XX :ReservedCodeCacheSize=128m"

# CONFIGURACION GARBAGE COLLECTOR
JAVA_OPTS="${JAVA_OPTS} -XX :+UseConcMarkSweepGC"
JAVA_OPTS="${JAVA_OPTS} -XX :+CMSIncrementalMode"
JAVA_OPTS="${JAVA_OPTS} -XX :CMSInitiatingOccupancyFraction=80"

I've checked the parameters with de wiki article that you provided and seem to be correct.
Besides here is a Eclipse-MAT report showing the objects contained in the heap dump:

The first image shows the objects without grouping:
http://img826.imageshack.us/img826/2680/uploadmat.png

The second one shows the objects grouped by class:
http://img708.imageshack.us/img708/9931/uploadmat2.png

Aparently, org.springframework.beans.factory.support.DefaultListableBeanFactory classes are consuming a great amount of memory.
What can be causing this?

Thanks for the help.

jpfi
Champ in-the-making
Champ in-the-making
Hi,
did you get an OutOfMemory for Heap or PermGen?
Cheers, jan

mcd
Champ in-the-making
Champ in-the-making
Hi Jan,

I get a heap OutOfMemory.

mcd
Champ in-the-making
Champ in-the-making
Hi,

Any ideas about this problem?

I also tried installing my project AMP in Alfresco 4.1.2 war, just to discard it could be related with my current version, but the results were the same.

Thanks in advance.