next up previous
Next: Java/HPF Interface Up: Implementation Previous: Implementation

Memory management

Fortran 90 and, at least in the standard, HPF, afford dynamic data structures, product types and the combination of both, which have been efficiently implemented by commercial compilers each in a proprietary way. A well-designed Fortran 90 code will heavily rely on these complex structures and will define ``constructors'' for each of them with dynamic memory allocation. The finite elements mesh is a typical example of this kind of object, on the Solver and on the Domain Manager as well. The domain decomposed sparse matrix is another example on the Solver. To be usable by Fortran code, such object must be constructed by Fortran code, because of the proprietary implementation details, and remain valid until de-allocated. Although the status of the native data is not clearly documented in the API specification, we never encountered memory management conflicts. Conversely, large Java arrays have to be accessed by the native methods, especially the RMI parameters. The JNI provides the notion of pinning a Java array against the GC, so that the native method can access this array without copy (provided that the layouts are compatible).



Cecile Germain
8/8/1998