Foren

How to increase JVM Memory options

thumbnail
srikanth arroju, geändert vor 14 Jahren.

How to increase JVM Memory options

Regular Member Beiträge: 133 Beitrittsdatum: 03.10.09 Neueste Beiträge
Hello All

I have tried to increase the tomcat server memory options from 1GB to 4GB. but tomcat server ius not starting up
its only taking the default values .

if not "%JAVA_HOME%" == "" (
set JAVA_HOME=
)

set JRE_HOME=%JRE_HOME%

set JAVA_OPTS=%JAVA_OPTS% -Xmx1024m -XX:MaxPermSize=256m -Dfile.encoding=UTF8 -Duser.timezone=GMT -Djava.security.auth.login.config="%CATALINA_HOME%/conf/jaas.config" -Dorg.apache.catalina.loader.WebappClassLoader.ENABLE_CLEAR_REFERENCES=false


Thanks & regards,
Srikanth A
thumbnail
Shagul Khaja, geändert vor 14 Jahren.

RE: How to increase JVM Memory options

Liferay Master Beiträge: 758 Beitrittsdatum: 27.09.07 Neueste Beiträge
Try it in setenv.sh or setenv.bat.

-Shagul
thumbnail
srikanth arroju, geändert vor 14 Jahren.

RE: How to increase JVM Memory options

Regular Member Beiträge: 133 Beitrittsdatum: 03.10.09 Neueste Beiträge
i have tried it in setenv.bat the server is not starting up when i increase memory option to
2 GB to 4GB .

Thanks & Regards ,
Srikanth A
thumbnail
Shagul Khaja, geändert vor 14 Jahren.

RE: How to increase JVM Memory options

Liferay Master Beiträge: 758 Beitrittsdatum: 27.09.07 Neueste Beiträge
Do you have that much of memory available? What is your JVM and server configuration?

Also what is the error that you see on the screen?

-Shagul
thumbnail
Olaf Kock, geändert vor 14 Jahren.

RE: How to increase JVM Memory options

Liferay Legend Beiträge: 6403 Beitrittsdatum: 23.09.08 Neueste Beiträge
Are you starting from startup.bat when you configure setenv.bat, or are you using the service? If you use tomcat as a service, configuration is done completely elsewhere, e.g. in the Registry. You can use tomcat6w.exe to access the settings or search for them in the registry.

The last thing I've heard about windows memory management (32 bit that is) is that the kernel takes 1GB of it. I believe that this has been the case up to XP, but this is just faded ancient knowledge on my side). Also, I believe there was a limit (could be around 1.5 G, not sure any more) that a 32bit JVM could allocate on 32bit windows due to some requirements about the organization of that memory (or so). You might want to consider using a 64bit stack to use all that memory.
thumbnail
srikanth arroju, geändert vor 14 Jahren.

RE: How to increase JVM Memory options

Regular Member Beiträge: 133 Beitrittsdatum: 03.10.09 Neueste Beiträge
Hello Olaf Kock

im starting with startup.bat it has 8GB of Ram and os is windows server 2003
32 bit machine

Thanks,
Srikanth A
thumbnail
Olaf Kock, geändert vor 14 Jahren.

RE: How to increase JVM Memory options

Liferay Legend Beiträge: 6403 Beitrittsdatum: 23.09.08 Neueste Beiträge
This article from 2005 is younger than your OS, so it should still apply. Looks like you'd better upgrade to 64bit in order to use the memory.
thumbnail
Manish Kumar Gupta, geändert vor 14 Jahren.

RE: How to increase JVM Memory options

Liferay Master Beiträge: 535 Beitrittsdatum: 16.05.08 Neueste Beiträge
I think, the problem is not that he is unable to use his 8 GB. I think, his server is not taking even 4 GB memory that a 32 bit should be able to use. So, I would suggest him to stick with 32 bit OS for now.

It seems that there is some problem in setenv.bat. Can you please again copy-paste what you have in your setenv.bat? Also, what exception you are getting while starting your tomcat?
thumbnail
srikanth arroju, geändert vor 14 Jahren.

RE: How to increase JVM Memory options

Regular Member Beiträge: 133 Beitrittsdatum: 03.10.09 Neueste Beiträge
Hello Manish,
intially it was

if not "%JAVA_HOME%" == "" (
set JAVA_HOME=
)

set JRE_HOME=%JRE_HOME%

set JAVA_OPTS=%JAVA_OPTS% -Xmx1024m -XX:MaxPermSize=256m -Dfile.encoding=UTF8 -Duser.timezone=GMT -Djava.security.auth.login.config="%CATALINA_HOME%/conf/jaas.config" -Dorg.apache.catalina.loader.WebappClassLoader.ENABLE_CLEAR_REFERENCES=false

i have changed it to


if not "%JAVA_HOME%" == "" (
set JAVA_HOME=
)

set JRE_HOME=%JRE_HOME%

set JAVA_OPTS=%JAVA_OPTS% -Xmx2048m -XX:MaxPermSize=512m -Dfile.encoding=UTF8 -Duser.timezone=GMT -Djava.security.auth.login.config="%CATALINA_HOME%/conf/jaas.config" -Dorg.apache.catalina.loader.WebappClassLoader.ENABLE_CLEAR_REFERENCES=false

i could not find the error in log file
thumbnail
Manish Kumar Gupta, geändert vor 14 Jahren.

RE: How to increase JVM Memory options

Liferay Master Beiträge: 535 Beitrittsdatum: 16.05.08 Neueste Beiträge
Can you tell me, what the error message on console when you execute "catalina run" command?
thumbnail
srikanth arroju, geändert vor 14 Jahren.

RE: How to increase JVM Memory options

Regular Member Beiträge: 133 Beitrittsdatum: 03.10.09 Neueste Beiträge
Manish Kumar Gupta:
Can you tell me, what the error message on console when you execute "catalina run" command?


Hello manish

C:\Liferay\liferay-portal-5.2.3\tomcat-6.0.18\bin>catalina run
Using CATALINA_BASE: C:\Liferay\liferay-portal-5.2.3\tomcat-6.0.18
Using CATALINA_HOME: C:\Liferay\liferay-portal-5.2.3\tomcat-6.0.18
Using CATALINA_TMPDIR: C:\Liferay\liferay-portal-5.2.3\tomcat-6.0.18\temp
Using JRE_HOME: C:\Java\jdk1.6.0_16\jre
Error occurred during initialization of VM
Could not reserve enough space for object heap
Could not create the Java virtual machine.

this is the error at tomcat console.and it is on 2008 enterpise edition 32 bit
in below link it supports upto 64GB

http://msdn.microsoft.com/en-us/library/aa366778%28VS.85%29.aspx
thumbnail
Olaf Kock, geändert vor 14 Jahren.

RE: How to increase JVM Memory options

Liferay Legend Beiträge: 6403 Beitrittsdatum: 23.09.08 Neueste Beiträge
srikanth arroju:
... it is on 2008 enterpise edition 32 bit in below link it supports upto 64GB...


Please, do read http://www.unixville.com/~moazam/. You'll see that Java needs a contiguous allocation of memory, not just any memory, and Windows just can't provide that. After all, the maximum contiguous amount in any 32 bit OS would be 2^32 aka 4 GB, no matter what can be provided in whatever segmented form to the application. There are some limits of math that just can't be bent. As long as Java requires the contiguous block of memory you need a 64 bit OS and JVM for the amount of memory you want to address. No configuration can get around that.

You might want to look into non-Sun JVMs as a last resort, but as I don't have experience with any of them, I can just provide this pointer. It might be that these can provide more memory than Sun. Personally though, I still believe that going 64bit is the easier path.
Anis Ben Mahmoud, geändert vor 14 Jahren.

RE: How to increase JVM Memory options

New Member Beitrag: 1 Beitrittsdatum: 28.02.10 Neueste Beiträge
Hi,

I had the problem and this post helped me to resolve it even if I don't have the same config.
Look at what Shagul said.

https://www.liferay.com/zh_CN/community/forums/-/message_boards/message/4418158#_19_message_4418158

Good luck.

Anis
thumbnail
Olaf Kock, geändert vor 14 Jahren.

RE: How to increase JVM Memory options

Liferay Legend Beiträge: 6403 Beitrittsdatum: 23.09.08 Neueste Beiträge
The reason to suggest 64 bit is in the article that I linked: The JVM needs a single block of memory. It can only get 2G max without any segmentation. This memory is shared between the JVM itself, shared-libraries (DLLs) etc. and the heap space. Therefor the available heap space is limited to less than 2G, more likely around 1.5 G. The article talks about it in way more details than I can. Operating on 64bit gets around that limitation.
thumbnail
Brian Kim, geändert vor 14 Jahren.

RE: How to increase JVM Memory options

Expert Beiträge: 311 Beitrittsdatum: 17.08.04 Neueste Beiträge
Olaf Kock:
The reason to suggest 64 bit is in the article that I linked: The JVM needs a single block of memory. It can only get 2G max without any segmentation. This memory is shared between the JVM itself, shared-libraries (DLLs) etc. and the heap space. Therefor the available heap space is limited to less than 2G, more likely around 1.5 G. The article talks about it in way more details than I can. Operating on 64bit gets around that limitation.


I think Olaf is right here. If memory serves me right, on a 32 bit Windows machine, the maximum amount of memory you can allocate to the JVM is 2 GB. On a previous project, I remember only being able to allocate 2 GB of memory to one instance of Liferay. In fact, while the machine had 4 GB, to leverage all 4 GB, we had 2 instances of Liferay both using 2 GB each on the same machine.