• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 8532
  • Last Modified:

Is my Java process running 32 or 64bit? Solaris

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
XDanny322
Asked:
XDanny322
  • 2
  • 2
1 Solution
 
Brian UtterbackPrinciple Software EngineerCommented:
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
 
XDanny322Author Commented:
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
 
Brian UtterbackPrinciple Software EngineerCommented:
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
 
XDanny322Author Commented:
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

Important Lessons on Recovering from Petya

In their most recent webinar, Skyport Systems explores ways to isolate and protect critical databases to keep the core of your company safe from harm.

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now