Questions tagged [phantom-reference]

A Phantom Reference refers to a reference type of objects in java. It is the weakest of the reference types. If an object is finalized, but its memory is not yet reclaimed, is phantomly referenced. Alternative of deprecated finalization via finalize() method

A Phantom Reference refers to a reference type of objects in java. It is the weakest of the reference types. If an object is finalized, but its memory is not yet reclaimed, is phantomly referenced.

See also JavaDoc and Wikipedia.

51 questions
0
votes
4 answers

Member-function pointers and phantom classes

I've been messing about with member-function pointers in relation to a previous question. In the code below I call methods on a class (B) that change a variable (count) in it, but I never make an instance of this class. Why does this work? #include…
slashmais
  • 7,069
  • 9
  • 54
  • 80
0
votes
1 answer

Java, webdriver, phatom.js unable to find element ajax call - response on the page

First I want to say thanks for read and thanks for possible solutions. I have problem to find element after ajax call - response on the page. I use Java, webdriver and phantom.js as tools. In my case phantom.js can access webelement only if I have…
0
votes
2 answers

How to report memory leaks in Android/Java using PhantomReference

After reconstructing an old piece of code I once wrote, then forgot, now rewritten... I am putting it here as a wiki for all to use :-) So, basically: If you got memory leaks in a complex Android app, containing images and cross-references. How…
rubmz
  • 1,947
  • 5
  • 27
  • 49
0
votes
1 answer

Importance of phantomreference in java

I wanted to understand the below statement in bold. What does it means? (Link) An object which overrides finalize() must now be determined to be garbage in at least two separate garbage collection cycles in order to be collected. When the first…
S Kr
  • 1,831
  • 2
  • 25
  • 50
0
votes
2 answers

Will I avoid using Reflection during finalization with PhantomReferences?

Let's say that I created a class MyClass that implements Closable. So in the close() method I am going to free some very important recources. Well since it is very important recources I created some kind of safety network (as recommended in…
Anton Kasianchuk
  • 1,177
  • 5
  • 13
  • 31
-1
votes
4 answers

$n = 2; 10-$n = 87

well this is what i am doing: $total = (array_sum($odds))+$evens; $total = str_split($total); echo 'total[1]: '.$total[1].'
'; echo '10-$total[1]: ' . (10-($total[1])); and the output is: total[1]: 2 10-$total[1]: 87 my guess is it is being…
Hailwood
  • 89,623
  • 107
  • 270
  • 423
1 2 3
4