3 ms·
this is not a bug. author doesn't seem to understand how jvm or managed memory works. he uses memory from parent object in child code without holding a referenc
by pdeva1 12y ago
this is not a bug. author doesn't seem to understand how jvm or managed memory works.
he uses memory from parent object in child code without holding a reference to it in child object. If his code was in pure java this simply won't be possible. The only reason he is able to do this is via native code.
Even in native code, it is wrong to have a pointer to managed memory without using the Global/Local Ref() methods that the jvm provides.
In summary, the jvm is behaving correctly with respect to GC. Author doesn't know how to use JNI and has caused the crash.
- xxxyy 12y agoThe author has not written the bad code. From what I understand he was just debugging it. >The dashboard was written in Java, and the source was available (under a 3-clause BSD license), so I dove in, (...) Also, nowhere in the post he says that it is JVM's fault.
- im2w1l 12y ago>The issue was that Java was making an unsafe optimization (I never bothered to figure out if it is the compiler or the JVM making the mistake, I was satisfied once I had a work-around). He says it was the JVM or the compiler's fault. He doesn't blame the code.
- coryfklein 12y agoIMO, whether he though this explicitly or not, he was really just disagreeing with the Java spec. Of course, effectively any bug you encounter could be dealt with by blaming the spec writers, but in this case I may agree with him. Depends on how much this particular optimization saves.