point ID limitation for LAS Dataset / Java SDK

285
1
07-26-2012 12:38 PM
JosephMcGlinchy
New Contributor III
Hello everybody,

I am working with the LAS Dataset API in the ArcGIS ArcObjects for Java SDK. I am aiming to re-classify some LAS points within my LAS dataset that fall witihin a specific area, and am running into some "Out Of Memory" issues.

My LAS Dataset is very dense, and currently I have thinned it so it contains 40 million points. I am looping through each point individually using the nextAttrLong method from the ILasPointEnumerator interface:

nextAttrLong(int arraySize,
                  int[] pPointCount,
                  _WKSPointZ[] pPoints,
                  int[] pAttribute,
                  ILongArray pIntensity,
                  ILongArray pFileIndices,
                  IDoubleArray pPointIDs);


What I am finding is that as I get above 20 million points the Java runtime is unable to allocate 4 bytes of memory to store the next index generated in pPointIDs, the index being of type INT. Since this is in Java, the point ID is only stored in the first element of the double array pPointIDs, so I am extracting that element and adding it to a different double array. 

The max allowable number by an INT in Java is 2,147,483,639 (found this through a search). This is a far cry from the number of points I am dealing with. One thing I tried is to loop through the points up to 20 million, do my reclassification, then loop through the rest of the points. This still results in the out of memory error.

The full error is below:

#
# There is insufficient memory for the Java Runtime Environment to continue.
# Native memory allocation (malloc) failed to allocate 2 bytes for GetStringUTFChars
#
#  Out of Memory Error (memory/allocation.inline.hpp:58), pid=1208, tid=5284
#
# JRE version: 7.0_05-b06
# Java VM: Java HotSpot(TM) Client VM (23.1-b03 mixed mode, sharing windows-x86 )
# Failed to write core dump. Minidumps are not enabled by default on client versions of Windows
#


The fact that it is failing to allocate memory for a String is confusing to me. I am not referencing any String variables in my code, so the only thing that comes to mind is something within the nextAttrLong() method. Any thoughts?

Cheers,
Joe McGlinchy
Tags (1)
0 Kudos
1 Reply
JosephMcGlinchy
New Contributor III
I should also say that I am printing out the ID of the points that I am saving off since this is still in development phase. That may also come into play.
0 Kudos