Logo 
Search:

Java Forum

Ask Question   UnAnswered
Home » Forum » Java       RSS Feeds

Out Of Memory Exception

  Asked By: Almas    Date: Jan 10    Category: Java    Views: 2504
  

I'm working on a J2EE-based project. The application server which is
used in the project, is Bea Weblogic 8.1. There is a problem in order
to deploy the application.
The maximum value which can be set for the memory is 3G. Nevertheless,
The out of memory exception is occured sometimes. I don't know whether
the above story is related to restrictions of the application server
or there is something else which I have not considered.

Note :
1- the other memory arguments, like MaxPermSize, PermSize,
MaxPermHeapExpansion, were added also.
2- the memory of the server (64-bit) which the application is
deployed on, is 16GB.

Share: 

 

6 Answers Found

 
Answer #1    Answered By: Lughaidh Fischer     Answered On: Jan 10

What is the full stack trace? Which JDK are you using? Do you see anything abnormal if you run the server  with Sun 1.5 and look at jconsole's memory  panel? If this is not an option, can you turn on GC logging and send us the log?

 
Answer #2    Answered By: Aalia Arain     Answered On: Jan 10

Sorry for incomplete information about the question. In fact, The
application has two mode, online and batch. There is no problem  in
online part. The out of memory  Exception was occured in the batch
mode, which is the multi-thread part. Almost all users were logged out
in batch mode, also. Because of a few reasons, The weblogic  is present
in the batch mode, unfortunately.
You know what I mean, The question is , "Why I can't use at least half
percentage of the server  memory?"

Note :
1- JDK 1.4 is used.
2- hibernate is used also.
3- Logs during starting the webLogics are as the following:
I. "Invalid maximum  heap size : -Xmx4G
could not create the java virtual machine."

II. "Error occured during initialization of VM
could not reserve enough space for object heap"

III. "An unexpected error was encountered during the deployment
process. - with nested exception:
[java.lang.OutOfMemoryError].
java.lang.OutOfMemoryError
at java.util.zip.ZipFile.open(Native Method)
at java.util.zip.ZipFile.<init>(ZipFile.java:112)
at java.util.jar.JarFile.<init>(JarFile.java:127)
at java.util.jar.JarFile.<init>(JarFile.java:79)
at
weblogic.j2ee.J2EEApplicationContainer.explodeEar(J2EEApplicationContainer.java:\
5093)
at
weblogic.j2ee.J2EEApplicationContainer.prepare(J2EEApplicationContainer.java:896\
)
at
weblogic.j2ee.J2EEApplicationContainer.prepare(J2EEApplicationContainer.java:823\
)
at
weblogic.management.deploy.slave.SlaveDeployer$Application.prepare(SlaveDeployer\
.java:3029)
at
weblogic.management.deploy.slave.SlaveDeployer.prepareAllApplications(SlaveDeplo\
yer.java:967)
at
weblogic.management.deploy.slave.SlaveDeployer.resume(SlaveDeployer.java:349)
at
weblogic.management.deploy.DeploymentManagerServerLifeCycleImpl.resume(Deploymen\
tManagerServerLifeCycleImpl.java:229)
at
weblogic.t3.srvr.SubsystemManager.resume(SubsystemManager.java:131)
at weblogic.t3.srvr.T3Srvr.resume(T3Srvr.java:966)
at weblogic.t3.srvr.T3Srvr.run(T3Srvr.java:361)
at weblogic.Server.main(Server.java:32)

 
Answer #3    Answered By: Terence Mitchell     Answered On: Jan 10

This looks like a configuration problem  since the error happens at the start up. Your application  will consume memory  if this succeeds. Try setting a lower maximum  memory, and if you are using a 32-bit OS you will not be able to use a 4G memory space. A 64-bit OS and 64-bit JDK combination might mitigate the problem.

 
Answer #4    Answered By: Adalwin Fischer     Answered On: Jan 10

in application  server startup

this is for tomcat-apcahe

java_opts = -Xms(half of ur ram)m -Xmx(half of ur RAM)m

 
Answer #5    Answered By: Skye Hughes     Answered On: Jan 10

you are using 32bit jdk(jdk1.4) which wouldn't be able to allocate more than 2GB memory,if your application  needs more memory  try to use 64bit jdk(like jRockit 1.5 x64 ,jRockit1.6 x64) and WebLogic9.2 or weblogic10 x64 on x64 OS platform. besides don't forget to tune gc.

 
Answer #6    Answered By: Funsani Chalthoum     Answered On: Jan 10

If you have increased the size of heap size and got no result , then there may be some problem  with your code.
In normal conditions it's enough to set  the max size of the heap to 1GB.
Have you used hibernate in your application?

 
Didn't find what you were looking for? Find more on Out Of Memory Exception Or get search suggestion and latest updates.




Tagged: