• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Allocating more memory to JVM

 
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am using a python library which makes use of a jar file. During runtime, it says memory is insufficient for JVM and to allocate more memory to it. I found that this can be easily done when launching using command line by passing -Xmx argument. But as you can see, my case is different. I need to somehow set the JVM memory before executing my python script.
 
Raghuram Vadapalli
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Can you be more specific?
 
Rancher
Posts: 4801
50
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
How does the python code launch the Java code?
 
Bartender
Posts: 10780
71
Hibernate Eclipse IDE Ubuntu
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Raghuram Vadapalli wrote:I am using a python library which makes use of a jar file. During runtime, it says memory is insufficient for JVM and to allocate more memory to it. I found that this can be easily done when launching using command line by passing -Xmx argument. But as you can see, my case is different. I need to somehow set the JVM memory before executing my python script.


Stick the command (with the extra arguments) in another script would be my suggestion.

However, before you do that you might want to investigate why your Python script uses so much memory. Maybe it's just a "Python thing", but the defaults are usually fine for most Java programs - in fact, I can't remember the last time I had to change them.

Winston
 
Raghuram Vadapalli
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
@Winston Gutkowski, you are right. Actually, I was using nltk in python which used stanford dependency parser jar. I was passing a whole paragraph instead of sentence which resulted in insufficient memory.
 
reply
    Bookmark Topic Watch Topic
  • New Topic