Skip to Content
Menu
This question has been flagged
2 Replies
5076 Views

Hello, I have found something "strange"(or not)

when I trying to use subprocess in openerp for a java call I always encounter a JVM error with memory limit issue.

this post probably have the same thing :

https://www.odoo.com/forum/Help-1/question/No-way-to-use-subprocess-in-OpenERP--51016

 

It's code like that :

proc = subprocess.Popen(['java', '-jar', 'myJar.jar', args1, args2])

proc.communicate()

and my error was:

'Error occurred during initialization of VM\nCould not reserve enough space for object heap\n'

'Error: Could not create the Java Virtual Machine.\nError: A fatal exception has occurred. Program will exit.\n'

 

I use the worker option when I run openerp. I delete this option and now my call workfine.

So I think this is a limitation from python thread or System to limit the memory for thread...

I don't know if it's this but, it make sense for me.

Did someone know something about this ?

 

Thanks clement

Avatar
Discard
Best Answer

I am also having this problem. Did you found an answer? 

Avatar
Discard
Best Answer

Hi

You can use multiprocessing of python

from multiprocessing import Process, Queue

queue = Queue()

p = Process(target='your method name', args=(queue, 'your method arg'))

p.start()  

 

Avatar
Discard