Solved

Is my Java process running 32 or 64bit? Solaris

Posted on 2008-06-23
4
8,287 Views
Last Modified: 2013-12-27
Hi,
In windows, I can tell if a processes is 32 or 64 by looking @ the processes in the taskmgr, and if a process has *32, then its 32bit.

How can i see if a process is 32 or 64 in solaris?  This is what i see when i do java -d64 -version:

[home@HA-TS01 17:37:27 ~]$ java -d64 -version
java version "1.5.0_14"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_14-b03)
Java HotSpot(TM) 64-Bit Server VM (build 1.5.0_15-b04, mixed mode)
[home@HA-TS01 17:37:31 ~]$

Is there a ways i can tell?
Thank you
0
Comment
Question by:XDanny322
  • 2
  • 2
4 Comments
 
LVL 22

Expert Comment

by:blu
Comment Utility
I am not sure what you are asking. Or rather, I thought I knew until you did the example execution with java. Obviously that JVM you ran in your example is running in 64 bits. Are you asking if how to tell if a currently running jvm is also running in 64 bits?
0
 

Author Comment

by:XDanny322
Comment Utility
Maybe i was a bit confused when i asked.

Basically, i have a solaris x86 solaris 10 64bit system.  i have java both 32bit and 64bit installed. (this is because if you want 64bit java in solaris, you MUST have 32bit. http://www.java.com/en/download/help/5000010700.xml)

when i do java -version, this is shown:
[Danny@HA-TS01 19:39:34 ~]$ java -version
java version "1.5.0_14"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_14-b03)
Java HotSpot(TM) Server VM (build 1.5.0_14-b03, mixed mode)
[Danny@HA-TS01 19:39:37 ~]$

when i do java -d64 -version, this is shown:
[Danny@HA-TS01 19:39:38 ~]$ java -d64 -version
java version "1.5.0_14"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_14-b03)
Java HotSpot(TM) 64-Bit Server VM (build 1.5.0_15-b04, mixed mode)
[Danny@HA-TS01 19:39:53 ~]$

I assume that this tell me that when i do java -version, i am calling java 32bit.  And when i am doing java -d64 -version, i am calling 64bit.

Question is, in solaris, when is process is up, how do i know if its taking 32bit or 64bit JVM?

(in windows, you can pull up the taskmgr and see if the process has a *32 next to it, then its 32bit.  If not, then its 64bit.  This assume you have 64bit system, and O/S)

Hope the clear it up a bit? thx
0
 
LVL 22

Accepted Solution

by:
blu earned 500 total points
Comment Utility
Okay, now I get it. There are two ways. One, is you can just to a "ps -f -p pid" (where pid is the process id of the process in question) and look to see if it says just "java" or if there is a long path that has "amd64" in it somewhere. The process at /usr/bin/java is 32-bits, but if the JVM wants to use 64-bits (like if you said -d64) it execs the java under the JDK in the amd64 directory.

The other way (and more sure) is to use the pflags command. Simply run "pflags pid" (same pid as before) and it will include a line at the top of the output that says "data model" which will have either a 32 or 64 in it somewhere.
0
 

Author Comment

by:XDanny322
Comment Utility
Thanks Blu.

Now just to keep everyone else together, this is what i got from pflags

32bit process :
[danny@HA-TS01 23:54:54 ~]$ pflags 1984
1984:   /usr/jdk/instances/jdk1.5.0/jre/bin/java -Ddanny_TRADEMONITOR -DJIN
        data model = _ILP32  flags = ORPHAN|MSACCT|MSFORK
 /1:    flags = ASLEEP  pollsys(0x0,0x0,0x8042d48,0x0)
        sigmask = 0x00000004,0x00000000
 /2:    flags = DETACH|ASLEEP  lwp_cond_wait(0x8102048,0x81


64bit process
danny@HA-TS01 23:55:08 ~]$ pflags 1844
1844:   /usr/jdk/instances/jdk1.5.0/jre/bin/amd64/java -Ddanny_APPSERVER -D
        data model = _LP64  flags = ORPHAN|MSACCT|MSFORK
 /1:    flags = ASLEEP  lwp_cond_wait(0x42be60,0x42be48,0x0,0x0)
        sigmask = 0x00000004,0x00000000
 /2:    flags = DETACH|ASLEEP  lwp_cond_wait(0x42da50,0x42da38,0x0,0x0)
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Let's say you need to move the data of a file system from one partition to another. This generally involves dismounting the file system, backing it up to tapes, and restoring it to a new partition. You may also copy the file system from one place to…
Installing FreeBSD… FreeBSD is a darling of an operating system. The stability and usability make it a clear choice for servers and desktops (for the cunning). Savvy?  The Ports collection makes available every popular FOSS application and packag…
Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
Learn how to find files with the shell using the find and locate commands. Use locate to find a needle in a haystack.: With locate, check if the file still exists.: Use find to get the actual location of the file.:

744 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now