Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / April 2008

Tip: Looking for answers? Try searching our database.

Runtime.getRuntime()

Thread view: 
zamba - 16 Apr 2008 13:28 GMT
Hi. i'm running under solaris 10 ... and i have this problem:

running an external aplication from command line in s.o works fine and
no cpu consume.
running from java with runtime.exec the same sh it eats my 85% of cpu

Runtime rt = Runtime.getRuntime();
    try {
        Process proc = rt.exec("/opt/ANTHaxfov42/bin/XSLCmd -i /opt/
ANTHaxfov42/etc/XfoSettings.xml -d "+ full_xml_file + " -s " +
full_xsl_file +  " -o " + full_pdf_file + " -silent");
    } catch (IOException e) {
        // TODO Auto-generated catch block
        e.printStackTrace();
    }

any ideas ?

tks !!!!!
Roedy Green - 16 Apr 2008 20:45 GMT
On Wed, 16 Apr 2008 05:28:46 -0700 (PDT), zamba
<CRISTIAN_FERRERO@hotmail.com> wrote, quoted or indirectly quoted
someone who said :

>running an external aplication from command line in s.o works fine and
>no cpu consume.
>running from java with runtime.exec the same sh it eats my 85% of cpu

What happens to the output in both cases?
Signature


Roedy Green Canadian Mind Products
The Java Glossary
http://mindprod.com

Elliot - 24 Apr 2008 18:18 GMT
Hi

I'm having the same kind of problem with:

Process server = Runtime.getRuntime().exec(exeCommand);

"execCommand" is the full path to an .exe file. This takes up to a
minute to load from Java and but the same program runs instantaneously
from the command line. Also CPU utilization is high.

The same Java application is running on many different machines and
the slowdown is only occurring on a few of them. So something is PC
specific but we can't isolate. The PC had 2 gig of memory is a P4 3.07
Gigs.

I wonder if there a different, more efficient Java class to load an
exe?

Anyway, any ideas are more than welcome.

Thanks

Elliot
Matt Humphrey - 24 Apr 2008 18:45 GMT
> Hi
>
[quoted text clipped - 15 lines]
>
> Anyway, any ideas are more than welcome.

Perhaps there's something inefficient in whatever you're using to read the
output and error streams.  What are you using for that?  (Generally
speaking, not reading them is not optional)

Matt Humphrey http://www.iviz.com/


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.