[vtk-developers] How to catch OutOfMemory errors using VTK with Java

Timothy M. Shead tshead at sandia.gov
Mon Jun 22 10:46:28 EDT 2009


Jeff Baumes wrote:
> Someone else may be able to answer better, but even if you wrote your 
> application in C++, I don't think that VTK throws exceptions for things 
> like out of memory errors.

operator new throws a C++ exception for out-of-memory conditions, so any 
code that invokes it (directly or indirectly) may cause an exception. 
Converting those C++ exceptions into Java exceptions would require 
modifications to the wrapper-generator, to put a try-catch block around 
every method that calls into C++.  Boost.Python does this, for example.

Cheers,
Tim

-- 
Timothy M. Shead
Data Analysis & Visualization (1424)
Sandia National Laboratories
505-284-0139




More information about the vtk-developers mailing list