How to control the size of the native memory available to jep

54 views
Skip to first unread message

SemanticBeeng

unread,
Jun 2, 2018, 1:54:56 PM6/2/18
to Jep Project
Hi,

I call python program from jep and getting this:

jep.JepException: <class 'ValueError'>: signal only works in main thread
at /development/bin/python/conda3/envs/dev-ds/lib/python3.6/signal.signal(signal.py:47)

After I disable the signal with 

signal.signal = lambda *args: None

it works.

How can this be explained?

I also noticed the program crashes the JVM sometimes.
Have a suspicion it is related to native memory allocation from the Python program.

How to .... manage this from jep or the jvm?
Are there ways to control or monitor the native memory available to jep?

Thanks
Nick




Nathan Jensen

unread,
Jun 4, 2018, 11:30:47 AM6/4/18
to Jep Project
If you look at the Python documentation for signal, it must always be used on the main thread.  Jep intentionally hides the main thread from developers because Jep using the main thread with CPython extensions can lead to bad things like deadlock with the GIL.  This is mentioned on other posts in the Jep google group and/or on issues on Jep's GitHub pages.

You can set how much maximum default direct memory size that Java uses for direct buffers.  https://docs.oracle.com/javase/8/docs/technotes/tools/unix/java.html#BABCBGHF  Note this will not constrain the size of memory used in Python, it will only constrain the memory used by nio Java direct buffers.  To the best of my knowledge you cannot constrain the memory size of the Python.

If you're getting a crash you need to analyze the hs_err_pid file that Java produces upon JVM crash.  That should provide clues as to why your application is crashing.

--
You received this message because you are subscribed to the Google Groups "Jep Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jep-project+unsubscribe@googlegroups.com.
To post to this group, send email to jep-p...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jep-project/91865c19-19b4-48a0-b8bf-c94eab37819e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages