SourceForge has been redesigned. Learn more.
Close

#182 Document how to override new/delete to use Java heap

closed-accepted
None
5
2007-08-10
2007-06-26
No

Using the Java heap to allocate C++ objects does two things, (1) re-establishes the JVM's heap limits even for SWIG wrapped code and (2) puts more pressure on the garbage collector to finalize objects (and thus free the SWIG objects that are unreachable)

This technique was presented at Usenix 2007
http://www.usenix.org/events/usenix07/poster.html

This patch includes an approximately 70 line chunk of code that, if included in a SWIG interface file, will move all SWIG C++ objects into the Java heap. If this proves popular or effective in practice, the community might consider making it an automatically generated option for Java builds.

Discussion

  • Jeffrey Sorensen

    Patch to Java.html adding section 20.7.5

     
  • William Fulton

    William Fulton - 2007-08-10

    Logged In: YES
    user_id=242951
    Originator: NO

    Committed for 1.3.32 with a few formatting changes in the C++ source. Great idea, thanks.

     
  • William Fulton

    William Fulton - 2007-08-10
    • assigned_to: nobody --> wsfulton
    • status: open --> closed-accepted
     

Log in to post a comment.