Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Runtime exec

 
Karthik Veeramani
Ranch Hand
Posts: 132
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have to execute a command line many times when some event is triggered. For this Ive been using Runtime.exec() for executing each command line. This seems to take up a lot of memory. Is there a better way to do it?
 
Michael Ernest
High Plains Drifter
Sheriff
Posts: 7292
Netbeans IDE VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
"Karthik" -
Please review our site's naming policy at your earliest convenience. We prefer that all screen names follow this convention. Thank you.
There are other ways to accomplish what you want, but none of them are nearly so simple as what you're doing now. For more efficient use of resources, you'll probably need to create a program that can thread your command-line invocations within a single process space.
It's also possible that what you're invoking might be easily rewritten to be more efficient.
 
Karthik Veeramani
Ranch Hand
Posts: 132
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks. And sorry about the name, I've changed it to my full name.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic