Hashcode ID for Java Object

My friend, and I have the following bid:

You can retrieve it Objectfrom memory using the Identity Hashcodeone obtained for this Object, using System.identityHashCode()at Java. With the restriction that it has not yet been cleared by the garbage collector.

I have been looking for an answer for a long time, and I could not find a specific one.

I think it is possible to do this with help JVMTI, but I have not worked with it yet.

Do any of you have an answer to this? Buy you a coffee pot if I can do it on your site;)

Thanks in advance, Felix

ps: I say that such behavior can be achieved, and my friend says that this is impossible.

+4
source share
4 answers

, .

  • , . ( ) -.
  • , Eden, Survivors .
  • , .

, , , .

BTW 64- JVM OpenJDK/Oracle - 1, , sun.misc.Unsafe.;)

BTW2 31- - ( 32-), , , . Object.hashCode() System.identityHashCode() .

+7

, . Java/JVM , , -.

Phantom , .. , , , , "" Phantom -, . identityHashCode .

C ++ , , , .

+1

, HashCodes . .

0

. identityHashCode : hashCode. ( ).

HashCode , ( HashCode ).

0

All Articles