pyjnius icon indicating copy to clipboard operation
pyjnius copied to clipboard

Windows 7 64-bit: Error occurred during initialization of VM

Open yassam opened this issue 10 years ago • 4 comments

I managed to install jnius on Windows 7 (I had to use MinGW to build it - I got compiler errors using Visual C++) but when I try to "import jnius" at the python prompt I get the following:

Error occurred during initialization of VM
Could not reserve enough space for object heap
Segmentation fault

I tried logging out and back in (as suggested elsewhere) but it made no difference.

I have 64-bit Windows 7, but I'm using 32-bit Python and JDK.

Python version 2.7.6.

I have 8GB of RAM.


Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.

yassam avatar Jan 20 '14 00:01 yassam

I have gotten the same error message with identical specs to those listed above except 12GB of RAM.

bevanj avatar May 07 '14 09:05 bevanj

Interestingly, when I had only 3 GB of RAM this issue NEVER occurred. Today, immediately after upgrading to 8 GB, this started happening!

Even doing from jnius import autoclass causes this issue just as import jnius does.

Note: This post hints at this problem also and provides a workaround: https://github.com/kivy/pyjnius/issues/65

Logging out and logging back in temporarily does in fact temporarily fix the problem in some cases.

I have:

Windows 7 64 Bit 32-bit Python 2.7.6 32-bit 7.55 JDK I installed jnius through sikuli_cpython - https://github.com/kevlened/sikuli_cpython

evbo avatar May 19 '14 21:05 evbo

Also, note this fork: https://github.com/kivy/pyjnius/pull/110

It provides a means of limiting the VM heap size before you import jnius. After installing from this fork: https://github.com/abrasive/pyjnius (using the usual python setup.py install), usage looks like this:

import jnius_config
jnius_config.add_options('-Xmx512m') # or something reasonable for your application
# import jnius like you did before...
from jnius import autoclass

evbo avatar May 20 '14 14:05 evbo

my os: Windows 10 64 Bit 32-bit Python 2.7.11 32-bit jdk1.8.0_73 The error occurs when the jvm.dll path is server Xmx < 600M;But it works when jvm.dll path under client;

chunyisong avatar Apr 16 '16 08:04 chunyisong