This week's book giveaway is in the OCPJP forum.
We're giving away four copies of OCA/OCP Java SE 7 Programmer I & II Study Guide and have Kathy Sierra & Bert Bates on-line!
See this thread for details.
The moose likes Tomcat and the fly likes JDK 6 automatically detect AMD-64 bit Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCA/OCP Java SE 7 Programmer I & II Study Guide this week in the OCPJP forum!
JavaRanch » Java Forums » Products » Tomcat
Bookmark "JDK 6 automatically detect AMD-64 bit" Watch "JDK 6 automatically detect AMD-64 bit" New topic
Author

JDK 6 automatically detect AMD-64 bit

Pat Farrell
Rancher

Joined: Aug 11, 2007
Posts: 4659
    
    5

This may not be officially an advanced question, but this seemed like a decent place.

After years of writing Java applications. I'm putting a Tomcat/JSP application on a quad processor AMD64 system with 12GB of ram, a terabyte of RAID disks, seven NICs, etc. So the server is advanced.

Does the Sun JVM automatically detect the CPU's 64 bit-ness and do the right thing?

Are there switches I need to use to tell Tomcat that it can use 5GB of Ram?

Thanks
Pat
Ernest Friedman-Hill
author and iconoclast
Marshal

Joined: Jul 08, 2003
Posts: 24187
    
  34

The JVM won't detect 64-bitness, but you can (and should) install a 64-bit JVM. If you go to the JDK 6 download page, you'll see that three of the versions you can grab are AMD64 JVMs for Solaris, Linux, and Windows. Such a JVM will know all about 8-byte pointers and other such goodness.

Since I'm not lucky enough to have the use of such a beast meself, I'm not 100% sure of this, but I believe that telling Java (Tomcat) how much heap to use just uses the normal Java command-line switches (-XmxNNNNm, etc) ; their acceptable range of arguments is just bigger.
[ November 13, 2007: Message edited by: Ernest Friedman-Hill ]

[Jess in Action][AskingGoodQuestions]
Ben Souther
Sheriff

Joined: Dec 11, 2004
Posts: 13410

Originally posted by Pat Farrell:
Are there switches I need to use to tell Tomcat that it can use 5GB of Ram?


Depending on your OS and (if Windows) the way you've installed and are running Tomcat the method for changing your heap setting differ.
How are you starting Tomcat?
[ November 13, 2007: Message edited by: Ben Souther ]

Java API J2EE API Servlet Spec JSP Spec How to ask a question... Simple Servlet Examples jsonf
Pat Farrell
Rancher

Joined: Aug 11, 2007
Posts: 4659
    
    5

No, not Windoze.
Some Debian, some Ubuntu

mostly via Apache

Sometimes inside Netbeans 5.5
Ben Souther
Sheriff

Joined: Dec 11, 2004
Posts: 13410

On your *nix boxen, you can set the heap size in tomcat/bin/catalina.sh.
Look for the JAVA_OPTS description in the header.

Here's mine:




You can verify that the setting 'took' by viewing the ServerStatus page in the tomcat manager/html application






I've never used the embedded version that ships with Netbeans so I don't know how to set this there. Someone else might.
[ November 13, 2007: Message edited by: Ben Souther ]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: JDK 6 automatically detect AMD-64 bit