wood burning stoves*
The moose likes Performance and the fly likes Running external executable from java Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Java » Performance
Bookmark "Running external executable from java" Watch "Running external executable from java" New topic
Author

Running external executable from java

Dilshan Edirisuriya
Ranch Hand

Joined: Apr 22, 2006
Posts: 299
I wanted to execute an external exe from java. For this I have used an intermediate bat file and through the bat file I am executing the exe. This works fine and I get my expected results. But I have issues in this approach when executing this file under User Account Control (UAC). In Windows Vista and Windows 7 when UAC enable this take some time to execute. Also when the external exe file becomes large the time taken to execute keeps on increasing (For a 200 MB file it takes 15-20 second delay to pop up with executable). So is there any alternative solution to this approach? Also if its a .net soluton will I encounter the same issue?

Thank you


Dilshan Edirisuriya SCJP1.4, SCWCD1.4, SCBCD 5
William Brogden
Author and all-around good cowpoke
Rancher

Joined: Mar 22, 2000
Posts: 12805
    
    5
Since you are executing a bat file, there is no reason to think that Java has anything to do with the delay.

Presumably you are providing for handing the stdOut and stdErr streams as described in the java.lang.Process JavaDocs.

Bill
Dilshan Edirisuriya
Ranch Hand

Joined: Apr 22, 2006
Posts: 299
Thank you William for your reply.

But why is this happen in java applications. A solution like .net does not encounter such performance issues. So I suspect this has something to do with java. Any ideas?
William Brogden
Author and all-around good cowpoke
Rancher

Joined: Mar 22, 2000
Posts: 12805
    
    5
Perhaps there is a low memory condition and the operating system is spending time paging your Java program memory in and out?

If this was my problem I would try monitoring CPU use and memory paging etc. - how much memory are you working with and how much does your Java program use?

Bill
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Running external executable from java