Garbage Collection in JyNI - How to bridge Mark/Sweep and Reference Counting GC
Stefan Richthofer

TL;DR
This paper discusses how to implement garbage collection in JyNI by integrating Java's GC with native C extensions, enabling compatibility with native Python extensions in Jython.
Contribution
It introduces a method to bridge Java's mark/sweep GC with reference counting for native extensions in JyNI, enhancing Jython's compatibility with native Python code.
Findings
Developed a hybrid GC approach for JyNI
Enabled support for native extensions like NumPy and SciPy
Improved Jython's compatibility with native Python modules
Abstract
Jython is a Java-based Python implementation and the most seamless way to integrate Python and Java. It achieves high efficiency by compiling Python code to Java bytecode and thus letting Java's JIT optimize it - an approach that enables Python code to call Java functions or to subclass Java classes. It enables Python code to leverage Java's multithreading features and utilizes Java's built-in garbage collection (GC). However, it currently does not support CPython's C-API and thus does not support native extensions like NumPy and SciPy. Since most scientific code depends on such extensions, it is not runnable with Jython. Jython Native Interface (JyNI) is a compatibility layer that aims to provide CPython's native C extension API on top of Jython. JyNI is implemented using the Java Native Interface (JNI) and its native part is designed to be binary compatible with existing extension…
Peer Reviews
No public reviews on file for this paper yet. If you reviewed it on a platform where reviews are public (OpenReview, ICLR, NeurIPS, ICML), you can paste yours below so the community can read it here.
Code & Models
Videos
No videos yet. Explain this paper in a talk, walkthrough, or lecture? Add one.
Taxonomy
TopicsMunicipal Solid Waste Management · Agriculture, Water, and Health
