How do I control the number of threads?

I'm currently writing parts of a GUI front-end in Swing for an extremely resource-hungry C back-end. I built the thing out on the basic two-thread (main and event) protocol that all of the literature talks about. The initial plan was to have a number of somewhat different versions of this thing being called independently to serve as micro-GUIs for different parts of the back end. It was working pretty well by itself, but it caused some noticeable slowdown in the main program once I tried to bring up two of them, and some thread-tracking software has informed me that each of these calls is costing me on the order of 27-28 threads. Is there anything I can do about this thread count? Is it normal? Would building all of the versions into a single .jar with internal switching at least limit the damage? If it's not normal, what should I be looking for to bring it back down? I have not explicitly spawned or dealt with any threads other than main and event.
If it is any help, the basic format is a JFrame containing a number of JPanels, some of which have a few subpanels. Some of the panels are swapped in and out of visibility by button presses. If the JPanels are somehow automatically creating event threads for themselves, is there any way I can limit that, perhaps by forcing them to use the event thread of the parent?
Thank you for your time.
Fibula

IF you're talking GUI, and you were, yes you can definitely reduce thread count by running everything in the same jvm

Similar Messages

  • How to find out the number of threads created under java vm at runtime

    our application seems to have hit the max number of threads that can be created under vm and the vm will just hang after that. that behavior seems to be consistent from an article that I read earlier.
    I wonder any way that java app can find out the number of threads currently created under vm?
    thanks in advance!

    If you are not starting an extra thread group you can use the Thread.activeCount method. But this willnot return all the threads, as there are some jvm threads, i.e. garbage collector. Also if you are running on a Unix type operating system then you can send a signal to the jvm to give you a thread dump, i think the signal is sighup.
    If the application is hanging i would of thought that you have a deadlock situation rather then the JVM not being able to create new threads, roughly how many threads should be running ??

  • How do you control the number of rings before voic...

    When people call me, Skype rings far to many times before voice mail comes on.  How do you reduce the number of rings on an inbound call, so that voice mail comes on in 4 to 5 rings?

    Hi, billwalker1125,
    Skype does not determine when to send calls to voice mail by the number of rings, but instead by the amount of time that has elapsed.  Check your settings (in Windows, it would be Tools -> Options -> Calls -> Voice Messages -> Start recording a voice message if ...   Remember to Save your changes!
    Regards,
    Elaine
    Was your question answered? Please click on the Accept as a Solution link so everyone can quickly find what works! Like a post or want to say, "Thank You" - ?? Click on the Kudos button!
    Trustworthy information: Brian Krebs: 3 Basic Rules for Online Safety and Consumer Reports: Guide to Internet Security Online Safety Tip: Change your passwords often!

  • How do I control the number of audio tracks in an exported QT movie?

    I am at a loss. I have 59.94 fps DVCProHD files that I want to trim and to export in the same format. The original clips have two tracks of audio, but the exported tracks have eight tracks of audio. I normally use an 8-track audio card, but nothing I do seems to prevent the 8-track export: I have selected "stereo downmix" in the audio mixer tool and set the audio playback device to "Built-in Audio," to no avail. I want the exported files to have the same two audio tracks as the original, not two plus an empty six. There seem to be no controls that allow me to specify this. Can anyone explain to me what is going on and how to change it?
    Thanks.
    I am using FCP 5.0.4
    G5 Dual2.7GHz   Mac OS X (10.4.5)  

    Hello Robert,
    It might be that your sequence is set to output 8 channels. try this...
    Go to Sequence>Setting> and go to the 'Audio Outputs' tab. Here, change the 'Outputs' to 2.
    You might also want to check the track-assign buttons on the timeline, ctrl+click on the auto assign square (just to the right of the little padlocks) and go to the Audio Outputs. Check that each track is assigned to 1&2.
    J

  • Limit the number of threads

    Hello,
    I am developing an application which has to execute untrusted Java source code. The Java security manager is helpful in preventing unauthorized network and local file system access, but as far as I can tell, it can not limit the number of threads created by the untrusted application.
    How would I limit the number of threads an untrusted Java application is allowed to create?
    Jure
    Edited by: zbontarj on Feb 16, 2009 9:46 AM

    zbontarj wrote:
    Create a custom ThreadGroup will allows only a limited number of threadsI can't see any methods in ThreadGroup that limit the number of threads. There is a method that returns the number of active threads in the group, but that doesn't help me out much.ThreadGroup is not designed for easy extensibility.
    You can either take a copy and modify it to take a thread limit. (You can override the default implementation by using -Xbootclasspath/p:path or adding a jar to lib/endorsed however this may contravene the JDK license.)
    Or you can write a thread which monitors threads in the thread group every few seconds.
    Or you can use the SecurityManager to check the threads in the thread group. The SecurityManager is called each time a thread is added and it can check the threads in the current thread group.

  • Controlling the processing of threads(MDB) simultaneously in BPEL

    Hi all,
    i have a BPEL process which hits an Oracle API.While doing stress testing(making 1000 calls to the API simultaneously), the EBS workflow goes down.
    This bulk testing is required so we cannot ignore it.
    Kindly give us solutions so that we can control the number of threads in BPEL which are calling the API simultaneously.
    Regards
    ayush

    Hi Ayush,
    Here are few options you can try:
    1) Instead of directly sending data from Siebel, you can store that data on some staging DB tables on Siebel side OR can create file(s) out of that. Then, BPEL process can use inbound adatper to poll these data. Here, BPEL PM can use minimumDelayBetweenMessages to control the input to the BPEL PM. The overall effect would be the less simultaneous API calls.
    2) You can reduce the number of threads for the domain as Rod suggested to throttle the processing. Again, the effect would be the same.
    3) If a single process instance makes multiple API calls in fire-and-forget fashion in a loop, then after each call use Wait activity to wait for some fixed amount of time. This will allow the previous call to complete or nearly complete before making another call and hence reducing the number of simultaneous API calls.
    Hope this helps.
    Regards,
    http://www.ibiztrack.com
    http://www.ibiztrack.com/html/oraclel-soa11g-bpel-esb-training.html

  • How to control the number of fields in the Advanced mode in af:query

    Hi,
    How to control the number of fields in the Advanced mode in <af:query>?
    Say i have 20 fields in my table and i created a view criteria with 2 fields. It would work perfectly in Basic mode. But in the Advanced mode all other fields selection is possible on clicking the ADD Fields button. I did not want the client to make a search with all 20 fields. Only 10 fields are to be listed in the Advanced Mode even though there are 20 fields in my table.
    How do i control the list of fields in ADDFields button?
    Any ideas?
    KR

    You can uncheck the Querable property of the attributes which you need not show up in the Advanced Mode (but they will not show up in other modes too !) or programatically set the same as mentioned here -
    http://adfcodebits.blogspot.com/2010/11/bit-27-setting-view-object-attributes.htmlAlso you can hide the AddFields button as suggested here - http://www.notjustjava.com/2011/12/cool-tips-to-showhide-components-of-the-query-control-of-adf/

  • How to control the number of instances of an object ?

    Hi all,
    Can anybody answer, How to control the number of instances of an object being created?
    suppose at any point of time, if i would like to have 5 instances at the maximum, how can i disable the further requests?
    Thanks in advance
    Pradi

    write a factory method that controls the number of instances for you:
    import java.util.List;
    import java.util.Arrays;
    public class Bar
       private static final int MAX_BARS = 5;
       private static int numBars = 0;
       private int id;
       public static void main(String [] args)
          try
             int numBars = ((args.length > 0) ? Integer.parseInt(args[0]) : MAX_BARS+1);
             Bar [] bars = new Bar[numBars];
             for (int i = 0; i < bars.length; ++i)
                bars[i] = Bar.create();
             System.out.println(Arrays.asList(bars));
          catch (Exception e)
             e.printStackTrace();
       private Bar() { this.id = numBars++; }
       public String toString() { return "I am bar number " + this.id; }
       public static Bar create()
          Bar nextBar = null;
          if (numBars < MAX_BARS)
             nextBar = new Bar();
          return nextBar;
    }%

  • Bode Analyzer: How to control the number of points per decade?

    Total newbie here. I cannot control the number of points per decade in the Bode VI. It's always 5 points per decade.
    Don't even know how to get the Elvis Version #, but it's at least 4.1, cuz the Elvis installer won't install 4.1 (says current version is newer). Running WinXP. 
    How can I get Elvis to respond to my request for more points per decade?
    Mike
    Solved!
    Go to Solution.

    Hi Mike,
    If you're ever curious about what drivers that you have installed, you can view it using Measurement & Automation Explorer (Start » All Programs » National Instruments » Measurement & Automation Explorer).  Once their, navigate to My System » Software, and you'll find NI ELVISmx along with it's version.  
    This behavior that you're seeing is a known issue, filed under Corrective Action Request (CAR) #373017.  For now, the number of points per decade will remain at 5.  Please wait for the next update of NI-ELVISmx to see if this is fixed.
    Cheers,
    Che T.
    Applications Engineer
    National Instruments

  • How do you modify the default Execute thread count in Weblogic Server 9.2?

    How do you modify the default Execute thread count in Weblogic Server 9.2?
    How can you tune the starting number of weblogic.ExecuteThread on server startup and/or set minimum number?
    Is there an option from the console?
    Please let me know.
    Thanks

    Self tuning will automatically manage the threads but however you can still control the min and max by adding the min and max values for each instance either directly adding in config.xml or through JVM settings
    1) Modifying the config.xml
    Just add the following line(s) to each server definition :
    <server>
    <name>AdminServer</name>
    <self-tuning-thread-pool-size-min>100</self-tuning-thread-pool-size-min>
    <self-tuning-thread-pool-size-max>200</self-tuning-thread-pool-size-max>
    </server>
    2) Adding some JVM parameters
    It's safer the following way :
    add the following option in your command line : -Dweblogic.threadpool.MinPoolSize=100
    Regards
    RR

  • Is there a way to control the number of consumed messages from JMS?

    Hi everyone,
    I have a BPEL process that is consumes messages from a foreign queue, performs a transformation, and passes it to Oracle Apps. I'm curious if there is a way to control the number of messages consumed at a time for processing.
    For example, if we place 50 transactions on this queue, I would like to only consume 10. And then as each one is processed and passed to Oracle Apps, I would like to pull another transaction off the queue. So basically I would only be processing 10 at the most.
    The issue I am having is we put 50 on the queue and the 50 are take off right away. But then half are making it into Oracle Apps and the remainder is failing with a JCA Connection Factory max connection error.
    Instead of changing the settings to get more through, I am wondering if it's possible to limit the number being processes at any one time.
    Thanks

    Hi,
    Have a look at the adapter.jms.receive.threads Property for JMS Adapter...
    http://docs.oracle.com/cd/E21764_01/core.1111/e10108/adapters.htm#BABCGCEC
    Cheers,
    Vlad

  • How do I increase the number of lines presented in a drop down list?

    When I am entering a single character/number for each of a random selection of three letters in a password verification, I get a drop down list from A to S only, the first 20. Accessing letter T to number 9 means scrolling down. How can I increase the number of lines in a drop down box to 36?

    Hi canddski,
    If you are taking about an interface on a website, this is up to the ui designer. But there is a reflow that depends on screensize for the Firefox UI.
    You can use asp to control the list:
    [http://forums.asp.net/t/1970301.aspx?How+can+i+display+selected+no+of+records+from+datatable+using+dropdown+list+without+database+]
    but also try asking on stackoverflow.com

  • How can I control the order of playback on MuVu Mix (USB 2.

    What determines the order of playback of music files stored on the MuVu Mix (USB 2.0)? How can I control the order?
    Apparently it is not name order. The music titles are prefixed by sequential numbers. But that is not the order that the files play back.
    I tried erasing all contents, then copying the files one by one to the MuVo Mix in the order that I want them to play back (name order). But that is not the order that the files play back.
    By the way, in both case, I removed the ".dat" file first. (I also tried keeping the ".dat" file, to no avail.)

    SSR wrote:
    > on the newer MuVos (which I would have thought included the Mix)
    > it's filename order. Other than that it's hard to know, but it sounds
    > like you ought to contact Support to check.
    I did, and they confirmed (very quickly; kudos!) what you and I both expect: the play order is determined by the alphabetical order of the file names. The mistake was mine. I ass-u-me-d that the MSWin folder "Name ^" order was correct. I did not realize that it is not exactly alphabetical when the file name begins with a number (e.g, the track number). I had renumbered songs from a second CD by simply adding 00 to the track number. Thus, songs and 2 of the first CD are played after songs 08 and 09 of the second CD, as they should alphabetically, even though they appear in the order , 2, 08, 09 in the "Name ^" list. Klunk! Mea cupla!

  • How do I change the number of rings on my phone?

    how do I change the number of rings on my phone?

    Call your provider and ask them to do it.
    This is not controlled from the iphone.

  • How can i control the timings of my slideshow using iphoto on my ipad

    Q: 1 how can i control the timings of my pupil's slideshows using iPhoto on the iPad?
    Q: 2 then how can i export them?
    Q: 3 how can i combine them from 8 individual slideshows to 1 for showing to their parents at an assembly?
    many thanks in anticipation of your collective help
    brian

    Here's my take on the same thing:
    Short answer: the dpi is set when you decide what size you're printing at.
    Long Answer: Dpi means nothing in the digital world of your computer. There are no "inches" to have "dots per..." Size is measured in pixels. That's the same on your camera. It doesn't take 10 x 8 or 6 x 4 shots. It takes shots measured in megapixels. For instance 4,000 x 3,000 is a 12 megapixel camera.
    Using that example, that shot from that camera has 12 million pixels. So that's how many "Dots" there are. To decide the ratio of dots per inch, you now need to decide the "inches" part. And that's printing. Print at 10 x 8 and the dpi will be 4,000/10 or about 400 dpi. At 6 x 4 then it's 4,000/6 or 660 dpi. Work the other way: Print at 300 dpi and the resulting image will be about 13 inches on the longer side.
    So, your photo as a fixed number of pixels. Changing the dimensions of the print will vary the dpi, changing the dpi will vary the dimensions of the print.
    For more see http://www.rideau-info.com/photos/mythdpi.html
    Regards
    TD

Maybe you are looking for

  • Return NULL when invoke Web Service via UTL_DBWS

    Hi all, right now, i'm using UTL_DBWS to acces Web Service via database.. but when i'm trying to get data from WEB SERVICE, using utl_dbws.invoke , i got NULL value. It happened if The result more than Varchar2 / 32767 byte. i'have tried to change co

  • Loss of space after reorg of compressed index

    Hi Oracle experts, In 2008 we compressed indexes of ECC system as per sap note 1109743 and obtained high compression ratio. Now we have upgraded to oracle 11.2.0.2 and BRTOOLS 7.20 (10). While using brtools to do table reorg/compression as per note 1

  • Display image from the attachment folder

    Hello, At the moment I am working on an embedded component for the marketing lead TI. The purpose of the component is to show a image stored in the attachment folder. In order to realize my plan I used a image control in the UI designer and bound it

  • Depreciation to WBS Element

    hai, Is it possible to post depreciation to WBS element. And also i want to know, whether it is possible to assign the asset to WBS element in time dependent tab in AS01. Can any one guide me on this. govind.

  • Html link not visible as table header in jsp

    Hi, I am not sure if this question belongs to JSP forum, since it's happening in JSP page I am posting it here. I am seeing this strange problem, in my JSP page all the link are looking fine except some links in Table header. Here is the code snippet