Foren

Home » Liferay Portal » English » 3. Development

Kombinierte Ansicht Flache Ansicht Baumansicht
Threads [ Zurück | Nächste ]
toggle
sricanth arroju
How to increase JVM Memory options
21. Januar 2010 07:30
Antwort

sricanth arroju

Rang: Regular Member

Nachrichten: 126

Eintrittsdatum: 2. Oktober 2009

Neue 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
Shagul Khajamohideen
RE: How to increase JVM Memory options
21. Januar 2010 07:37
Antwort

Shagul Khajamohideen

Rang: Liferay Master

Nachrichten: 759

Eintrittsdatum: 27. September 2007

Neue Beiträge

Try it in setenv.sh or setenv.bat.

-Shagul
sricanth arroju
RE: How to increase JVM Memory options
21. Januar 2010 08:23
Antwort

sricanth arroju

Rang: Regular Member

Nachrichten: 126

Eintrittsdatum: 2. Oktober 2009

Neue 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
Shagul Khajamohideen
RE: How to increase JVM Memory options
21. Januar 2010 09:18
Antwort

Shagul Khajamohideen

Rang: Liferay Master

Nachrichten: 759

Eintrittsdatum: 27. September 2007

Neue 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
Olaf Kock
RE: How to increase JVM Memory options
21. Januar 2010 11:44
Antwort

Olaf Kock

LIFERAY STAFF

Rang: Liferay Legend

Nachrichten: 1688

Eintrittsdatum: 23. September 2008

Neue 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.
sricanth arroju
RE: How to increase JVM Memory options
22. Januar 2010 00:52
Antwort

sricanth arroju

Rang: Regular Member

Nachrichten: 126

Eintrittsdatum: 2. Oktober 2009

Neue 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
Olaf Kock
RE: How to increase JVM Memory options
22. Januar 2010 02:13
Antwort

Olaf Kock

LIFERAY STAFF

Rang: Liferay Legend

Nachrichten: 1688

Eintrittsdatum: 23. September 2008

Neue 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.
Manish Kumar Gupta
RE: How to increase JVM Memory options
22. Januar 2010 02:24
Antwort

Manish Kumar Gupta

LIFERAY STAFF

Rang: Liferay Master

Nachrichten: 535

Eintrittsdatum: 15. Mai 2008

Neue 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?
sricanth arroju
RE: How to increase JVM Memory options
22. Januar 2010 03:39
Antwort

sricanth arroju

Rang: Regular Member

Nachrichten: 126

Eintrittsdatum: 2. Oktober 2009

Neue 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
Olaf Kock
RE: How to increase JVM Memory options
22. Januar 2010 04:20
Antwort

Olaf Kock

LIFERAY STAFF

Rang: Liferay Legend

Nachrichten: 1688

Eintrittsdatum: 23. September 2008

Neue 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.
Manish Kumar Gupta
RE: How to increase JVM Memory options
22. Januar 2010 07:25
Antwort

Manish Kumar Gupta

LIFERAY STAFF

Rang: Liferay Master

Nachrichten: 535

Eintrittsdatum: 15. Mai 2008

Neue Beiträge

Can you tell me, what the error message on console when you execute "catalina run" command?
Brian Kim
RE: How to increase JVM Memory options
22. Januar 2010 11:53
Antwort

Brian Kim

LIFERAY STAFF

Rang: Expert

Nachrichten: 319

Eintrittsdatum: 16. August 2004

Neue 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.
sricanth arroju
RE: How to increase JVM Memory options
25. Januar 2010 00:48
Antwort

sricanth arroju

Rang: Regular Member

Nachrichten: 126

Eintrittsdatum: 2. Oktober 2009

Neue 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
Olaf Kock
RE: How to increase JVM Memory options
3. Februar 2010 10:51
Antwort

Olaf Kock

LIFERAY STAFF

Rang: Liferay Legend

Nachrichten: 1688

Eintrittsdatum: 23. September 2008

Neue 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
RE: How to increase JVM Memory options
28. Februar 2010 09:07
Antwort

Anis Ben Mahmoud

Rang: New Member

Nachrichten: 1

Eintrittsdatum: 28. Februar 2010

Neue 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