Narendra Pathai
Narendra Pathai

Reputation: 41945

What implementation of heap does Java use?

Wikipedia on Heap lists down many implementations of heap. I was thinking as to what implementation does Java use for heap?

Is the decision kept on the JVM vendors or it is specified in JVM specification as to what implementation should be used?

Upvotes: 0

Views: 213

Answers (2)

user207421
user207421

Reputation: 310913

None of them. The heap in the Wiki entry you cited is a binary tree-based sorting data structure. The heap used by the JVM is a dynamic memory area. The Wiki-type is implemented by java.util.Heap, not by the JVM's heap. I know it's confusing but there it is. Note that the Wiki entry has a disambiguating note at the top.

Upvotes: 4

nanofarad
nanofarad

Reputation: 41281

The heap type is a decision of the JVM implementor. The JVM spec on heaps gives no indication as to a required or preferred type of heap.

Upvotes: 1

Related Questions