Set cpu affinity within java application
Hi,
I have a problem running my java applications (100% pure java, jdk 1.4.1) on windows 2000 systems with more that 1 CPUs.
The applications are Swing Java applications built using IBM Eclipse.
When the applications start I can see the process running using Window Task Manager but I cannot see the Swing window.
If I set, during the application start up, the process affinity to use just 1 CPU the application starts and runs without any problem.
Anyone has any hit about this problem?
There's a known issue with using multi-processor machines and Swing.
Basically, due to the fact that Swing is non-reentrant.
You can also get the problem is you have 2 different threads trying to
alter the same component on a single processor machine.
You might be able to minimise the problem by forcing your Swing code
to queue up nicely on the Swing event queue as follows.
final Runnable runnable = new Runnable()
public void run()
// any Swing code eg. panel.setColor ( Colour.blue );
}; // runnable
SwingUtilities.invokeLater(runnable);regards,
Owen
Similar Messages
-
X high CPU when using Java applications
Only recently, my Freemind program has become extremely sluggish and unresponsive (big lag) when moving my mind map around. Freemind is made with Java. If I move the mind map around, the X process shoots to 20% CPU, doesn't seem a lot but something between X and Java programs are really bringing their performance down.
I can barely use Freemind now. Freeplane is also affected.
I noticed if I keep the Freemind window really small, it's responsive. If I maximise it, everything slows down within the application. Adding new notes, or move the map around, shoots X to a high CPU and there is a 5+ second lag in anything I do in the app.
Is there anything I can do to improve performance? It's only started recently, everything is up-to-date.
Last edited by nLinked (2013-06-08 13:57:31)Hi
Try to use -Xloggc parameter with the jvm in order to see if problem comes on garbage colector. May be the mem usage is little and the gc thread is in active state. Try, also modify the mem usage with -Xms and -Xmx parameters and see the gc efects.
You can use the -Xprof to output cpu profiling data.
Also, find if there is a bug on servlet container / hard /SO you are using.
Hope this helps -
Report Execution from within Java application
I am currently running my Oracle reports through a Java application where I just create a HttpURLConnection to the reports server and push in my report request, and then read the connection input stream in order to obtain the generated report. This is working without too many problems except that in some cases where the report is generated but the application does not seem to understand the reponse.
I see that there is in fact a Java API available for the reports. Is it possible to integrate this into my application in the same/similar way as I am doing now? If so, where can I get the associated docs as the supplied Javadocs are not too explicit.
Thanks
JustinYou'll have to write a custom ClassLoader to do this - modifying the existing ClassPath from within the JVM just isn't possible.
-
Executing a perl script from within java application
Hi,
Does anyone knows a way to execute a perl script from within java.
---kirkRuntime.exec("perl myscript.pl");
Of course whether that "works" depends on what the script does and where the java program runs. -
Setting classpath within java application
Hi
Sorry if this question has already been asked, I've searched for it but couldn't find it.
I've written a class (see below) that when given a directory will add all of the jar files to the classpath.
The classpath is updated to include all of the jar files but if I try to use a class within one of these jar files then an exception is generated stating that the class can't be found.
Can anyone help me with this problem? I thought that I would only need to update the classpath.
Thanks,
Rob
public class Jar {
public static void addJarsToClasspath(String root) {
File f = new File(root);
if (f.exists()) {
File[] jars = f.listFiles(new FilenameFilter(){
public boolean accept(File dir, String file) {
return ((String)dir.getName()+file).endsWith(".jar");
String classpath = System.getProperty("java.class.path");
for (int i=0; i<jars.length; i++) {
classpath = classpath.concat(":"+root+"/"+jars.getName());
System.setProperty("java.class.path",classpath);
System.out.println(System.getProperty("java.class.path"));You can do this with batch files in Windows NT/2000:
1) create a batch file called "setcp.bat" containing the following:
for %%i in (C:\myPath\*.jar) do call appendcp.bat %%i
2) create another batch file called "appendcp.bat" containing the following:
set CLASSPATH=%CLASSPATH%;%1
Now you can run setcp.bat and it will add all JAR files in C:\myPath to your CLASSPATH.
Jesper -
HOW to play flash inside java application program
Do java provide any API for playing flash inside java application ?Pleae give me some help about it .Thank You ..
pingyi wrote:
Do java provide any API for playing flash inside java application ?Pleae give me some help about it .Thank You ..bro... I found out there from the internet... but you need to purchase it.
hope it meets your expectation...
JFlashPlayer is a Flash Player API Java package that lets developers play and interact with Adobe? Flash Player movies within Java applications. Advanced animations can improve the user experience and add to the professional appearance of an application. JFlashPlayer allows programmers to quickly add Flash movies to their Java application development for Windows.taken from: JflashPlayer -
Excel as a Component in java application
Can anyone please tell me that how can I use an Excel worksheet as a COM object within Java application. please reply urgently
look up www.tidestone.com, they had an MS Excel lib you could get for java. It is not free and they also just sold to another company. See if they still offer it.
-
How to set-up affinity to multiple CPUs
Is there a way to set CPU affinity of a process and all its LWPs.
I am using below configuration:
processor set 1 with n CPUs and allocated to p1,p2, p3 processes.
Inside processor set I want to set-up cpu affinity such that a process uses n/3 number of cpus with best effort.
--Don't want to create more processor set as at any time any of the process may use 100% of pset and other 2 remaining idle, don't want to apply strict boundaries between the processes.
--want to have cpu affinity for a process to more than 2 cores.
idea is to have parallel gc threads more than n/3 and maintain memory locality with best effort.Is there a way to set CPU affinity of a process and all its LWPs.
I am using below configuration:
processor set 1 with n CPUs and allocated to p1,p2, p3 processes.
Inside processor set I want to set-up cpu affinity such that a process uses n/3 number of cpus with best effort.
--Don't want to create more processor set as at any time any of the process may use 100% of pset and other 2 remaining idle, don't want to apply strict boundaries between the processes.
--want to have cpu affinity for a process to more than 2 cores.
idea is to have parallel gc threads more than n/3 and maintain memory locality with best effort. -
Invoking business rules 11g from Java application
We have SOASuite 11g running on weblogic and have read through documentation/played with Oracle business rules
We want to utilize business rules engine within our Java web applications deployed to glassfish server (Non SOA application). Is this even possible and does anyone use it in this way? Any pointer is much appreciated.
What are the libraries like Oracle rules SDK that I need to include in the classpath of Java web app?
This link assumes that web app is co-located in the same weblogic instance running SOASuite and doesn't help my case.
http://docs.oracle.com/cd/E23943_01/user.1111/e10228/non_soa.htm#BGBBCICB
By using it within Java application, we want to able to make local calls as opposed to calling a decision function as web service. Volume of actual rules and their usage is so high within our Java app. Also we want to take advantage of java beans defined in our business layer by using Java facts and without having to define XSD for XML facts.I had seen the blog, It explains how to test business rules by loading the dictionary from static rules file.
my requirement is to invoke the business rule engine running on the SOA server, from the application module. can you please help me in this.
Thanks inadvance.
-Murali -
Sun Java Application Server 9.0 and 9.1 - High CPU PROCENTAGE 100%
Hi,
I have problem with sun java application Server running after few days during watching a logs from web admin suddenly the application server takes 100% cpu and keeps this procentage - I have to manually close the server process.
The server running on Windows Server 2003.
Anyone have any idea to sovle the problem?Hi Kedar,
Thanks for the reply. Yes, I finally figured it out.
The custom MBeans seem to work well for the most part though I don't know for sure if I'm using them in the way they were really intended.
Basically, I want to run 'services' on my application server for the lifetime of the server. I want these 'services' to maintain things like runtime caching of information over time that is not persisted in a DB but needs to be kept around in active memory to be used at a later time, but only while the application server is up and running.
Another thing I would like to do is have them receive JMS notifications directly, but I seem to be having trouble when subscribing as a consumer within my custom MBean. The topic thread on that is here:
http://forum.java.sun.com/thread.jspa?threadID=5153124&tstart=0 -
I have an iMac with 2 internal drives and a multiple user account set-up. Hw do I create a path to store data files on the second drive within an application?
This is the Mac mini forum not the iMac forum however...
Applications written for average users like Photoshop, Word, i.e. GUI based applications provide a 'Save' dialog box which while allow selecting second drives or any drive. The dialob box initially shown might be in the simple mode but you just need to click on the triangle to show the full set of options. You should then see the different drive names amongst other options.
If your referring to an application your writing yourself then you need to build a pathname. This can be in one of two styles depending on the programming system your using. This could be a POSIX style path or a Mac style path.
POSIX = /Volumes/volname/foldername
Mac style = Volname:foldername: -
Is it possible to run a java application within a web browser?
Hello everyone here! I have a question about running a java application within a web browser and I would appreciate it very much if anyone here can give me some answers.
I have a standalone java application written with AWT. Basically this free application lets users to select spectral lines from a big file based on some criteria and plot those selected lines. Yes, it is a very simple application. Now I want to run this application within a web browser so that users don't need to download the application from the ftp site and thus don't need to install in their machine. Is it possible to run this application within browser? If yes, can we get the same plotting function as we run the application separately and where should I start out?
Thanks in advance!
kuilianPlease see the signed applet discussion group for details of how to avoid the applet security restrictions. You can sign the applet, or use the policy file containing {AllPermission} for testing purposes (though not suitable for widespread deployment).
Regards
Matthew -
How do I get rid of a java application unistall set that keeps popping up on everything I do
Every time I open Firefox I get the Java Application unistall set How do I get rid of it so I can Go to different sites without it popping up all the time.
Settings > iTunes and App Store > Apple ID = Sign Out...
Then Sign In using the preferred Apple ID.
Note:
Anything Downloaded with a Particular Apple ID is tied to that Apple ID and Cannot be Merged or Transferred to a Different Apple ID
Apple ID FAQs > http://support.apple.com/kb/HT5622 -
Calling a java application from within another class
I have written a working java application that accepts command line parameters through public static void main(String[] args) {} method.
I'm using webMethods and I need to call myapplication from within a java class created in webMethods.
I know I have to extend my application class within the webMethods class but I do not understand how to pass the parameters.
What would the syntax look like?
Thanks in advance!why do you want to call the second class by its main method ??
Why not have another static method with a meaningfull name and well defined parameters ?
main is used by the jvm as an entry point in your app. it is not really meant for two java applications to communicate with each other but main and the code is not really readable.
Have a look at his sample
double myBalance = Account.getBalance(myAccountId);
here Account is a class with a static method getBalance which return the balance of the account id you passed.
and now see this one, here Account has a main method which is implemented to call getBalance.
String[] args = new String[1];
args[0] = myAccountId;
Account.main(args);
the problem with the code above is
main doesn't return anything so calling it does do much good. two the code is highly unreadable because no one know what does the main do... unlike the sample before this one where the function name getBalance clearly told what is the function doing without any additional comments.
hope this helps.... let me know if you need any additional help.
regards,
Abhishek. -
Setting the system property in java application
Hi,
I want to make a connection to https://URL through my java application class
which will be deployed in the weblogic server. Could any one help by
telling how could I set the system properties in my java application. If I
pass the value in the java class do I have to change any value in the
weblogic.properties file.
Thanks in advance and looking forward to hear your valuable suggestion.
SirishaSystem.getProperty(..)
System.setProperty(..) is this what you are asking for?
This gets and sets the system (your machine) environment properties
Filip
In article <396d0a93$[email protected]>, [email protected] says...
>
Hi,
I want to make a connection to https://URL through my java application class
which will be deployed in the weblogic server. Could any one help by
telling how could I set the system properties in my java application. If I
pass the value in the java class do I have to change any value in the
weblogic.properties file.
Thanks in advance and looking forward to hear your valuable suggestion.
Sirisha
Filip Hanik
Software Architect
XMarkstheSpot.com
[email protected]
Maybe you are looking for
-
I am not able to see the time line and canvas in the motion 5. Also i am not able to click on it either
-
Photos are not dispayed correctly
All the pictures taken holding my camera vertically (portrait) are shown on the wrong side on my Iphone even if I rotated them on the computer before, Does anybody have a solution to that? Many thanks
-
IPOD Classic 160gb TV Out Mode
I just got my new 160gb IPOD Classic and it won't go into TV Out mode. Is anyone else having any trouble with is or does anyone have any suggestions on this? My resourced are kind of limited as I am currently in Baghdad so any help would be greatly a
-
I have PS CC 14.2.2 on Windows 7 Edit/Fill/Pattern/Script is supposed to offer 'Picture frames' and 'Trees' amongst other options like 'Brick Fill' and so on, but doesn't Why is it so?
-
Dynamic connection to eBusines Suite
Hi All, Is it possible to decide eBuiness Suite to be connected at runtime of a BPEL process? Our Requirement: We are creating an application that integrates with different (around 15) ebusiness Suites. We have same procedures compiled in all eBusine