Instance Counts for All Classes (excluding platform) 38006784 instances of class org.apache.derby.impl.store.access.sort.Node
One possibility is that the sorter is confused about how much memory is available. The sorter is very clever, and tries to figure out whether it can perform the sort in-memory, or whether it has to switch to an external (disk-based) sort, using temporary files to hold the partially-sorted data. If the sorter is confused about how much memory is available (i.e., thinks there is more memory available than there actually is), then it might drive the system out of memory. This would certainly be a bug, but not a leak exactly, rather a flaw in the internal-vs-external sort analysis code. thanks, bryan P.S. I'm still wondering if your memory issues are actually external to Derby; that is, if you've configured your JVM with memory sizes that exceed the memory available in the underlying operating system. That would cause Derby to attempt to allocate data structures that the JVM was willing to allow, but which the underlying OS refused to provide.
