• Post Reply Bookmark Topic Watch Topic
  • New Topic

Java Performance Companion and memory management principles  RSS feed

 
Phil Freihofner
Ranch Hand
Posts: 126
4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
On first glance, this new book looks very useful and interesting, regardless of whether it pertains to the question I wish to ask.

A current concern of mine is that I do not have a very complete grounding in general memory management issues as they relate to Java. I am mostly self-taught, but my education does include some classes back in the 1980's on cpu architecture and assembly language (at UC Berkeley, where I was a music major but dabbled in Comp Sci classes). I have something like 6 years of experience programming Java at this point, mostly audio-related, for game programming and real-time synths.

Are there sections in this book where memory management fundamentals are addressed? If not, is there a recommendation that anyone would be willing to provide?

I'd like to be able to read and understand articles such as this one: Memory management in LWJGL 3
 
Poonam Parhar
author
Greenhorn
Posts: 2
5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello Phil,

The Serviceability Agent chapter in the book has an example on how to diagnose OutOfMemoryError or potential memory leak issues. That example, and the tools discussed in that example might provide some insights into how to deal with the memory management issues.
 
Charlie Hunt
author
Greenhorn
Posts: 11
5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Phil Freihofner wrote:On first glance, this new book looks very useful and interesting, regardless of whether it pertains to the question I wish to ask.

A current concern of mine is that I do not have a very complete grounding in general memory management issues as they relate to Java. I am mostly self-taught, but my education does include some classes back in the 1980's on cpu architecture and assembly language (at UC Berkeley, where I was a music major but dabbled in Comp Sci classes). I have something like 6 years of experience programming Java at this point, mostly audio-related, for game programming and real-time synths.

Are there sections in this book where memory management fundamentals are addressed? If not, is there a recommendation that anyone would be willing to provide?

I'd like to be able to read and understand articles such as this one: Memory management in LWJGL 3


The article included a link could probably be more generalized into the notion that passing data across the Java / JNI boundary is an expensive operation. The article doesn't seem to really talk about why that's the case. Rather, it talks more about their experience and how to avoid their pain.
I don't know of a good book or article that talks in a lot of detail as to why crossing the Java / JNI bound is so expensive. We could probably summarize that into; some times the data being passed across the JNI boundary is copied, one thing that needs to be guarded is a situation where a GC thread executes, moves an object, while a thread is executing in JNI / native code. The JVM must ensure that the native thread doesn't access a stale object location. There is also some security overhead involved too.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!