• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Bear Bibeault
  • Junilu Lacar
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • salvin francis
  • Frits Walraven
Bartenders:
  • Scott Selikoff
  • Piet Souris
  • Carey Brown

Cannot allocate more than 1GB for Tomcat

 
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,

As per the project requirement I have to continue to use 32 bit JDK1.7 & Tomcat 7.x on windows environment, here tomcat is running as a windows service and I am using Tomcat7w.exe to configure the memory settings.

If I allocates more than 1 GB memory heap size the tomcat service is not starting and getting an alert as "windows could not start the apache tomcat 7 on local computer".

My application is a Java swing standalone and it is having image related data and it needs more than 1 GB memory and due to 1GB memory limitation the tomcat crashes after 5 to 6 days for a a load of around 300 users.

Can you please suggest me how to allocate more memory(2GB or 4GB).

OS : Windows 7 Enterprise with 16 GB RAM ( development machine) and Windows 2008 R2 SP1 with 16 GB RAM.
 
Saloon Keeper
Posts: 22503
151
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I really do hate idiot project requirements by people who are not as clever as they think they are.

The 32-bit JDM cannot own that much memory. You need the 64-bit version. And if you are attempting to run on a 32-bit version of Windows, you have even less memory available, since Windows itself takes up a lot of the RAM. 32-bit Windows has a 3 GB limit on RAM. Virtual memory won't help. And even if it did, the page thrashing would make the system unusable.
 
Pranav Kristam
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for the reply. Development & PROD OS are 64bit version and JDK/Tomcat is only 32 bit.

As per your information "32-bit Windows has a 3 GB limit on RAM"

Does it mean can we allocate up to 3 GB heap memory size for 32 bit JVM ? if yes, why it is not allowed to configure the same and not starting the tomcat service.
 
Ranch Hand
Posts: 624
9
BSD Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Pranav Kristam wrote:As per your information "32-bit Windows has a 3 GB limit on RAM"


This means total memory OS can access is 3 GB, not 3 GB for Java only.
If your OS is 64 bit and you got 16 GB RAM, then the issue is something different.

Can you tell exactly what values are you putting in intial memory pool and maximum memory pool in tomcat config?
 
Pranav Kristam
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes my OS is 64 bit with 16 GB RAM and as reference I used this URL (http://docs.oracle.com/cd/E19900-01/819-4742/abeik/index.html) to configure the performance tuning parameters under Java Options section :

-XX:MaxPermSize=256m
-XX:+UseConcMarkSweepGC
-XX:NewSize=400m
-XX:MaxNewSize=400m
-XX:SurvivorRatio=6

Initial memory pool : 1024 MB
Maximum memory pool : 1024 MB
Thread stack size : 1024 MB
 
Tim Holloway
Saloon Keeper
Posts: 22503
151
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Is the problem machine running both Tomcat AND a Swing application? Because that's how it appears based on what you said.

They would (should!) be running in independent JVMs, so their respective memory settings are independent of each other.

Regardless, if you are running 300 users for several days and Tomcat runs out of memory, that would make it appear that one or more of the webapps has a memory leak.

In which case, adding more memory basically just increases the number of days between crashes, so you need to track down and repair the leak.
 
Pranav Kristam
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Currently I am facing out of memory or tomcat crash problem on the server side, where the business logic is developed using Restful APIs (Jersey-1.17) and deployed on the tomcat server.

Yes the client and server are independent of each other. As a next step I will profile the application code, meanwhile customer is asking for an immediate workaround solution to increase the heap memory size from 1GB to 2GB or more.
 
This tiny ad is guaranteed to be gluten free.
Thread Boost feature
https://coderanch.com/t/674455/Thread-Boost-feature
    Bookmark Topic Watch Topic
  • New Topic