Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dereferencing JVM objects #403

Closed
AbdealiLoKo opened this issue Feb 5, 2019 · 1 comment
Closed

Dereferencing JVM objects #403

AbdealiLoKo opened this issue Feb 5, 2019 · 1 comment
Labels

Comments

@AbdealiLoKo
Copy link
Contributor

I'm trying to figure out how/if the JVM objects I create get dereferenced and available for garbage collection.

Was trying:

In [1]: import jnius

In [2]: jString = jnius.autoclass("java.lang.String")

In [8]: def abc():
   ...:     x=jString("a" * (256 * 1024 * 1024))
   ...:    # do something complex which creates a lot of big variables utilizing lots of RAM

If I call abc() multiple times, would the JVM automatically figure out that after function abc() finishes, all the Java objects created there can be garbage collected ?

I seem to be having memory issues and am trying to understand how memory management happens in the JVM with jnius

@github-actions
Copy link

👋 We use the issue tracker exclusively for bug reports and feature requests. However, this issue appears to be a support request. Please use our support channels to get help with the project.
Let us know if this comment was made in error, and we'll be happy to reopen the issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants