[vtkusers] vtkPoints, vtkIdsList, JNI memory errors and Jeff Lee!

Eugene Kim eugene at salk.edu
Sun Mar 26 22:16:19 EST 2006


Hi again,

 	This is about the third time i've posted about this issue in the 
past couple weeks.  I'm going to make this as clear as I possible can.

1) vtkPoints and vtkIdList are still broken.

 	As far as I can tell, accessing these objects is  not reliable in 
Java.  When testing my application with small meshes, I rarely encountered 
errors.  When I moved to testing with large meshes ( on the order of 
300000 polygons ), these structures consistently failed in Java resulting 
in a segfault and a stacktrace report that always pointed to a method in 
vtkPoints or vtkIdList.  After some inspection, it became clear that all I 
had to do was churn a large amount of print statements in between calls to 
these functions to break them.  It seemed at this point that the more I 
flipped Java memory, the more the JNI code would break.

 	The only thing that has gotten me anywhere at this point was to 
turn on incremental garabe collection in the JavaVM.  Others have 
suggested that I use other VM's, like IBM's, which might have better 
memory mangement.

2) I found a thread on this that is 4 years old

 	An old thread with exchanges b/t a vtk user and Jeff Lee outlined 
a fix to this ( or related problem ).  Now, I haven't actually tried this 
out yet, and I'm no expert on JNI, but upon inspection of this code in my 
own build and the suggested fix, they are indeed different.  Perhaps the 
newer code is the right code after all, but as far as I can tell it STILL 
DOES NOT WORK.  This thread is 4 years old, and I wonder if anyone could 
confirm any kind of fix.  ( Or even have a developer acknoweldge the 
problem ).  Because the problem also exists independently in vtkIdList for 
me, this problem does seem to be shared due to some oversight in the java 
wrapping code as Jeff Lee has stated.  Please someone, tell me i'm not 
crazy, ( or more bearably just stupid ).

3) I shouldn't even have to worry about vtkPoints

 	I'm going to use this as an opportunity to point out an even 
larger problem.  The only reason i'm even dealing with the vtkPoints data 
object is that vtkPolyData is not working properly, ( or again i'm just 
stupid ).  If I load in a .vtk file into a vtkPolyData object, all of your 
convenient methods which hold the vertices, lines, triangles, etc... do 
not work.  I cannot even query the number of vertices in the object, and 
the vtkCellArray which holds these objects does not exist.  These methods 
preumably exist to make my life easy, ( i have tried BuildCells and all 
that, could I be missing something? ), but I am forced to bypass them and 
gather every cell in my object, and then every point from every cell, and 
eliminate common points based on the point ids i recieve.  It's ugly, it's 
tedious, there are memory errors dealing with this, and I should not need 
to deal with it.

These past couple weeks i've been trying to convcine myself that I am not 
crazy and that these problems really do exist.  I wonder why it isn't a 
bigger issue, as these are very core objects in VTK.  Ideally, I would 
like someone to slap me in the face and show me what i should've been 
doing this entire time, but no one seems to want to answer =(.

Thanks for your patience,
Eugene Kim



More information about the vtkusers mailing list