Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Unique JVM identifier

 
Ed Ward
Ranch Hand
Posts: 147
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Greetings all!

Given a single computer running two JVM instances which have been started with identical configurations and command line properties, is there any attribute or environment property which uniquely identifies a given JVM instance?

I thought maybe looping through System.getenv(), but I do not see anything there which identifies the JVM instance.

I found this from awhile back but was wondering if maybe things have changed:

Can an application determine the JVM instance?



Thanks in advance!
 
Rob Spoor
Sheriff
Pie
Posts: 20527
54
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
There is one unique identifier - the process ID. You can't get this without JNI though, and unique only means unique at that moment. Nothing prevents the system from reusing your JVM process ID for another process after the JVM has shutdown.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic