Skip to main content

[java.lang.OutOfMemoryError: Java heap space] error while downloading files

2 replies [Last post]
appserver_user
Offline
Joined: 2006-10-17
Points: 0

I've kept some large files (aroung 100MB) inside /docroot folder. But when i try to download those files from multiple clients (3 to 5 downloads at a time) the server becomes slow and throws the following error:

[#|2009-05-13T13:57:47.000+1000|WARNING|sun-appserver9.1|javax.enterprise.system.stream.err|_ThreadID=33;_ThreadName=httpSSLWorkerThread-8080-9;_RequestID=1220cf44-418a-4dfb-ad63-92739a782bc4;|
java.lang.OutOfMemoryError: Java heap space
|#]

I am using the following setup:

Memory: 2GB
OS: Ubuntu 2.06 server
JDK: 1.6.0-b105
glassfish: v2_b58c

JVM settings:
-XX:MaxPermSize=192m
-server
-XX:+AggressiveHeap
-XX:-UseGCOverheadLimit
-Dcom.sun.enterprise.server.ss.ASQuickStartup=false
-Djava.endorsed.dirs=${com.sun.aas.installRoot}/lib/endorsed
-Djava.security.policy=${com.sun.aas.instanceRoot}/config/server.policy
-Djava.security.auth.login.config=${com.sun.aas.instanceRoot}/config/login.conf
-Xmx1400m
-Xms1400m
-Xss128k
-Djavax.net.ssl.keyStore=${com.sun.aas.instanceRoot}/config/keystore.jks
-Djavax.net.ssl.trustStore=${com.sun.aas.instanceRoot}/config/cacerts.jks
-Djava.ext.dirs=${com.sun.aas.javaRoot}/lib/ext${path.separator}${com.sun.aas.javaRoot}/jre/lib/ext${path.separator}${com.sun.aas.instanceRoot}/lib/ext${path.separator}${com.sun.aas.derbyRoot}/lib
-Djdbc.drivers=org.apache.derby.jdbc.ClientDriver
-Djavax.management.builder.initial=com.sun.enterprise.admin.server.core.jmx.AppServerMBeanServerBuilder
-Dcom.sun.enterprise.config.config_environment_factory_class=com.sun.enterprise.config.serverbeans.AppserverConfigEnvironmentFactory
-Dcom.sun.enterprise.taglibs=appserv-jstl.jar,jsf-impl.jar
-Dcom.sun.enterprise.taglisteners=jsf-impl.jar
-XX:NewRatio=2

Can anyone help me out to understand why i'm getting this error and if there is any possible workaround of this. Is there any other way to host large files in this server.

Thanks heaps.

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
Jeanfrancois Arcand

Salut,

I think you are facing:

https://glassfish.dev.java.net/issues/show_bug.cgi?id=3683

Can you update to 2.1 or a more recent version of GF?

Thanks

-- Jeanfrancois

glassfish@javadesktop.org wrote:
> I've kept some large files (aroung 100MB) inside /docroot folder. But when i try to download those files from multiple clients (3 to 5 downloads at a time) the server becomes slow and throws the following error:
>
> [#|2009-05-13T13:57:47.000+1000|WARNING|sun-appserver9.1|javax.enterprise.system.stream.err|_ThreadID=33;_ThreadName=httpSSLWorkerThread-8080-9;_RequestID=1220cf44-418a-4dfb-ad63-92739a782bc4;|
> java.lang.OutOfMemoryError: Java heap space
> |#]
>
> I am using the following setup:
>
> Memory: 2GB
> OS: Ubuntu 2.06 server
> JDK: 1.6.0-b105
> glassfish: v2_b58c
>
> JVM settings:
> -XX:MaxPermSize=192m
> -server
> -XX:+AggressiveHeap
> -XX:-UseGCOverheadLimit
> -Dcom.sun.enterprise.server.ss.ASQuickStartup=false
> -Djava.endorsed.dirs=${com.sun.aas.installRoot}/lib/endorsed
> -Djava.security.policy=${com.sun.aas.instanceRoot}/config/server.policy
> -Djava.security.auth.login.config=${com.sun.aas.instanceRoot}/config/login.conf
> -Xmx1400m
> -Xms1400m
> -Xss128k
> -Djavax.net.ssl.keyStore=${com.sun.aas.instanceRoot}/config/keystore.jks
> -Djavax.net.ssl.trustStore=${com.sun.aas.instanceRoot}/config/cacerts.jks
> -Djava.ext.dirs=${com.sun.aas.javaRoot}/lib/ext${path.separator}${com.sun.aas.javaRoot}/jre/lib/ext${path.separator}${com.sun.aas.instanceRoot}/lib/ext${path.separator}${com.sun.aas.derbyRoot}/lib
> -Djdbc.drivers=org.apache.derby.jdbc.ClientDriver
> -Djavax.management.builder.initial=com.sun.enterprise.admin.server.core.jmx.AppServerMBeanServerBuilder
> -Dcom.sun.enterprise.config.config_environment_factory_class=com.sun.enterprise.config.serverbeans.AppserverConfigEnvironmentFactory
> -Dcom.sun.enterprise.taglibs=appserv-jstl.jar,jsf-impl.jar
> -Dcom.sun.enterprise.taglisteners=jsf-impl.jar
> -XX:NewRatio=2
>
>
> Can anyone help me out to understand why i'm getting this error and if there is any possible workaround of this. Is there any other way to host large files in this server.
>
> Thanks heaps.
> [Message sent by forum member 'appserver_user' (appserver_user)]
>
> http://forums.java.net/jive/thread.jspa?messageID=346037
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@glassfish.dev.java.net
> For additional commands, e-mail: users-help@glassfish.dev.java.net
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@glassfish.dev.java.net
For additional commands, e-mail: users-help@glassfish.dev.java.net

appserver_user
Offline
Joined: 2006-10-17
Points: 0

Thanks a lot...looks like the new version has solved the issue...however, i am going to run some more test on it and will post an update later.

Thanks again.