How Many Threads inside JVm while running

Hi,
how many threads will be there in jvm of 1.4 or higher sdk? threads i mean it includes all jvm threads also.

How do you identify these threads?
I can see 8 threads in my 1.5 java process (just running a main) using windows XP task manager, but when I check how many threads there are from within the code, it only looks like 4:
java.lang.ThreadGroup[name=system,maxpri=10]
Thread[Reference Handler,10,system]
Thread[Finalizer,8,system]
Thread[Signal Dispatcher,9,system]
java.lang.ThreadGroup[name=main,maxpri=10]
Thread[main,5,main]
For example, using
Thread.currentThread().getThreadGroup().getParent().list();

Similar Messages

  • How many threads can be running at the same time

    Hi!!
    Dows anyone knows how many Threads can be running at the same time in the JVM.
    I'm making a multi thread client-server app and I would like to know how much simultneous connections the JVM support. I'm using one Thread per connection.

    Hi, thanks to all for your answers.
    I think that I made the wrong question, as you said: "that means the number of threads currently created".
    I'm worry about this because my application is already online (It's a mail server -SMTP and POP3 server using ORACLE for the users database- ) and some other user post in the "multi-tread forum" that almost any JVM can only have 700 threads created at the same time, and I've never heard or read anything about this.
    what you mean with the stack space (memory??)
    I'm using the JavaWebServer 2.0 and a servlet to start the main Thread.
    Again Thanks to all for the answers but I think that the schapel answer is the one that solve my doubt...

  • How many  threads are running?

    here's the code... i am trying to understand, at each point, how many threads are running:
    I understand that one thread belongs to the caller of the start()
    & at the same time there is another thread belonging to the instances of each thread (thread1, thread2, thread 3 etc.)
    1public class ThreadTester {
    2   public static void main( String args[] )
    3   {
    4      PrintThread thread1, thread2, thread3, thread4;
    5
    6      thread1 = new PrintThread( "thread1" );
    7      thread2 = new PrintThread( "thread2" );
    8      thread3 = new PrintThread( "thread3" );
    9      thread4 = new PrintThread( "thread4" );
    10
    11      System.err.println( "\nStarting threads" );
    12
    13      thread1.start();
    14      thread2.start();
    15      thread3.start();
    16      thread4.start();
    17
    18      System.err.println( "Threads started\n" );
    19   }
    }can you tell me if i am counting the number of threads in existance correctly...
    LINE#.....CALLER...START...TOTAL THREADS
    13..............1.........1.......2
    14..............1+1......1+1.....4
    15..............2+1......2+1.....6
    16..............3+1......3+1.....8
    so by the time line 16 executes i have a total of 8 threads,
    4 threads belonging to each caller plus
    4 threads created by start()
    or is it
    LINE#.....CALLER...START...TOTAL THREADS
    13..............1........1........2
    14..............1........1+1.....3
    15..............1........2+1.....4
    16..............1........3+1.....5
    after line 16 executes does the caller thread die, thus leaving only a total of 4 threads?
    there is only one thread belonging to the caller at line 13(plus the thread it creates).
    at the start of line 14, the previous callers thread is dead & now a new thread is created that belongs to the caller on line 14... etc.

    well, i realize at the end there would be 4 threads but im trying to get my head around this explanation in the book:
    "A program launches a threads executioin by calling the threads start method, which in turn call the run method. After start launches the thread, start returns to tis caller immediately. The caller then executes concurrently with the lauched thread." there fore if i have 2 concurrent processes, are there 2 threads running????
    now having said the above, my question was:
    for each line,
    how many threads are in existance at
    line13
    line14
    line15
    line16
    thanks.

  • How many Threads on a given system ?

    Is there a way to know for an AIR application how many threads a given system system supports?
    Pixel Bender is capable of real multi threading. It would not make sense to run 4 instances on a system with only 2 threads, but would be a shame not to utilize all threads of an 8 core hyper threading system.
    Thanks,
    David

    This appears to be a Flex question. Please try the flex forums http://forums.adobe.com/community/flex/flex_general_discussion

  • How many apple tvs can i run at once

    i want to set up a trade show booth with apple tvs and a mac mini. how many apple tvs can i run off a mac mini? i want to run different slideshows.

    Frank Caggiano wrote:
    Pretty sure that one device (the mini) will only be able to interact with one Apple TV.  At best you might be abel to connect to multiple ATVs but they would all run the same content. (and I have my doubts about that)
    You can use the mini and multiple Apple TV's to watch different content, indeed you can only watch different content although you can listen to the same content. For the avoidance of doubt different includes the same content but not in sync.

  • [solved] How many dbus process are you running?

    Hi there,
    Recently I looked how many dbus processes there are running on my system. I realised it is quite a few:
    ~ ps aux | grep dbus
    root 367 0.0 0.0 124760 3688 ? Ssl 07:31 0:00 /usr/sbin/thermald --no-daemon --dbus-enable
    dbus 374 0.0 0.0 27084 1952 ? Ss 07:31 0:01 /usr/bin/dbus-daemon --system --address=systemd: --nofork --nopidfile --systemd-activation
    lightdm 846 0.0 0.0 17992 544 ? S 07:32 0:00 /usr/bin/dbus-launch --autolaunch e8b37a474b614e438a0ab6a142101c2c --binary-syntax --close-stderr
    lightdm 896 0.0 0.0 26664 1040 ? Ss 07:32 0:00 /usr/bin/dbus-daemon --fork --print-pid 5 --print-address 7 --session
    lightdm 902 0.0 0.0 26664 1540 ? S 07:32 0:00 /usr/bin/dbus-daemon --config-file=/etc/at-spi2/accessibility.conf --nofork --print-address 3
    orschiro 1128 0.0 0.0 15896 616 ? S 07:32 0:00 dbus-launch --sh-syntax --exit-with-session
    orschiro 1129 0.0 0.0 27012 1496 ? Ss 07:32 0:00 /usr/bin/dbus-daemon --fork --print-pid 4 --print-address 6 --session
    orschiro 1445 0.0 0.0 17992 540 ? S 07:33 0:00 dbus-launch --autolaunch e8b37a474b614e438a0ab6a142101c2c --binary-syntax --close-stderr
    orschiro 1446 0.0 0.0 26664 1036 ? Ss 07:33 0:00 /usr/bin/dbus-daemon --fork --print-pid 5 --print-address 7 --session
    Is this the same for you?
    I do not start dbus manually anywhere on my system except for launching lightdm and thermald through a systemd service.
    Last edited by orschiro (2014-02-28 07:16:45)

    I will mark this as solved for now. In order to minimise the running dbus sessions, I switched back from ldm to startx and also removed the pulseaudio autostart from /etc/X11/xinit/xinitrc.d/ since I want to control myself when pulseaudio starts the dbus sessions.
    This is how it looks now with X running and udisks2/gvfs enabled dbus session.
    dbus 331 0.0 0.0 27048 1608 ? Ss Feb27 0:10 /usr/bin/dbus-daemon --system --address=systemd: --nofork --nopidfile --systemd-activation
    orschiro 1574 0.0 0.0 15896 448 tty1 S Feb27 0:00 dbus-launch --sh-syntax --exit-with-session
    orschiro 1581 0.0 0.0 27160 1396 ? Ss Feb27 0:00 /usr/bin/dbus-daemon --fork --print-pid 4 --print-address 6 --session
    orschiro 12920 0.0 0.0 26664 1216 ? S Feb27 0:00 /usr/bin/dbus-daemon --config-file=/etc/at-spi2/accessibility.conf --nofork --print-address 3
    orschiro 15516 0.0 0.0 17992 532 ? S 06:26 0:00 dbus-launch --autolaunch e8b37a474b614e438a0ab6a142101c2c --binary-syntax --close-stderr
    orschiro 15523 0.0 0.0 26664 964 ? Ss 06:26 0:00 /usr/bin/dbus-daemon --fork --print-pid 5 --print-address 7 --session

  • How many threads are used to load an webpage in webview?

    I implemented a custom version of cookiemanage to overcome the problem of cookies being stored retrived in the same place for webview (when assigning a custom cookiemanager to default cookiehandler before initializing webview ).
    This custom class uses thread local to create a new store for each thread, so i could have varius webview instance not using the same cookiestore.Well, it doesn´t work because
    webview apperantly creates about 20 threads for loading (login) a webpage.I´m guessing webview uses several threads to load an webpage, because in my custom implementation of cookiemanager each thread that request
    CookieHandler.getdefault() get a new cookie store, i did this with threadlocal.
    My question to the experts is ::
    - Is my teory correct and weview creats several threads to load a page or i´m missing something where?
    - Also having my problem is there an way i can restrict webview so it only creates one thread or at least only one thread that call cookiemanager.getDefault()?
    Even not knowing the answers to the above , any details on webview inside working relating thread could be helpfull.
    Many Thanks
    André

    To print all Threads;
    class Equitus {
        public static void main(String[] arg) {
            new Equitus().run();
        public void run() {
            ThreadGroup tg = Thread.currentThread().getThreadGroup();
            for(ThreadGroup parent; (parent=tg.getParent()) != null; tg=parent) ;
            Thread[] threads;
            do {
                threads = new Thread[tg.activeCount()];
            } while (tg.enumerate(threads)!=threads.length);
            System.out.println(java.util.Arrays.toString(threads));
    }

  • How many thread can I create?

    I wrote a multithread program. I use Excutors class and newCachedThreadPool method to create a thread pool.
    I want to create max threads that i can. In some where, I saw Max thread that is allowed, depends on OS, availabe memory, JVM.
    I use SUSE 11.1 as operating system, have 3.75 GB RAM & 7.5 GB swap & use jdk 1.6
    I want to create max threads that i can. I don't know how many i can create.
    please help me.

    Hi _Security, Mutli-Threading isn't always a good thing, because of the constant switching the processor has to do, causing it to be slower then it could be if you properly queued your tasks instead of threading each one. Each thread you create is another thing your processor has to execute each cycle, so if you have tons of threads, your processor will have to execute and switch through each one every cycle, making it bog down performance by a long shot.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

  • How to check whether JVM is running in interpreted mode

    I have launched JVM with -Xint option , but thread dump file doesn't include Monitor cache dump. AppServer is starting with -Xint but it is not logging Monitor Cache Dump. How will I check whether JVM is running in interpreyed mode or any other way to get Monitor Cache dump in Thread dump?

    Add -showversion to the command line and look for
    java -Xint -showversion Hello
    java version "1.6.0"
    Java(TM) SE Runtime Environment (build 1.6.0-b105)
    Java HotSpot(TM) Server VM (build 1.6.0-b105, interpreted mode)
    If you're running with the JIT, you'll see something like
    java -showversion Hello
    java version "1.6.0"
    Java(TM) SE Runtime Environment (build 1.6.0-b105)
    Java HotSpot(TM) Server VM (build 1.6.0-b105, mixed mode)

  • How see how many process in paralell are running?

    Hi friends!
    I need add a new process chain in the main meta- process chain ( a big one)
    How can I know how many process are running in paralell,
    and how many process still free or available to use,
    between a time range?  (ex: 12:00hs to 12:10hs)
    Thanks in advance!

    Hi
    There are various ways by which you can determine whether you have enough background work process to run something in parallel.
    1. When your process chain is running use transaction code SM66 to see how many background process are being used.
    For background work process you get TYPE as BTC.  Now monitor this screen for some time and you would know what is the maximum number of background process being used during your PC run.   Your Basis team member will be able to tell how what is the total number of background work process in your system.  Now you would be able to understand how many of these process remains free.
    2. You can run SM51 -
    > this will list you number of application servers you have. Double click on each of the server , it will take to to SM50 screen. Top side there will be clock sign. Click on that. This will give you the CPU time of each work process.
    i.e what is the time a wp was using CPU since last system restart.  If you see  for most of the background work process this time is in the range of 0 - 2 seconds , then they are mostly free .
    3. You would also get some of the valueable information from RSBATCH -
    >Background and Parallell Process -->DIsplay Background Process
    Regards
    Anindya
    Edited by: Anindya Bose on Jan 6, 2012 5:58 AM

  • How Many times the report has run

    Dear All,
    I am trying to find out if there is any standard report which shows me as to how many times the Z or Y repor has been used.
    This is really needed for me decide.
    with regards
    Ranjith Singh

    we created a solution that reads the information from STAT and stores it in a custom table for later retreival. we can then more closely monitor the amount of statistics kept without basis involvement. the function module to read the STAT information is:
      call function 'SAPWL_STATREC_READ_FILE'
           destination servers-rfcdest
           exporting
                read_client                 = sy-mandt
                read_end_date               = pstop
                read_end_time               = pstopt
                read_exclude_username       = 'SAPSYS'
                read_start_date             = pstart
                read_start_time             = pstartt
           tables
                v2_normal_records           = stats
           exceptions
                wrong_parameter_combination = 1
                others                      = 2.
    it takes some time to develop history, but we can now go back over a year to look at run time and execution trends by program, both ours and SAPs.
    HTH

  • A way to tell how many hours a computer has run

    Is there any way to tell approximately how many hours (like a car has an odometer) my PowerMac G4 1GHZ MDD has been run in total?
    Thanks,
    Awfers
    Message was edited by: Awfers

    Old World ROM Macs used to hold that info, along with the manufacturing date, in PRAM. It could be viewed with an old Demo version of TechTools and probably a couple of other freeware utilities. The problem was that, if you ever flushed PRAM via a CUDA reset or removed the PRAM battery, the info was lost.
    Older versions of Techtools (v3 and earlier for pre-OSX systems) had an option to save that PRAM data before zapping the PRAM or replacing the battery. The function to reload the saved data was labeled "Restore Mandate" if you want to search further.

  • How many threads can be created in a java swing program?

    At first, I intend to use Timer to create a 2D plot repeatedly after a certain number of milliseconds. This is for an animation. However, I discover that it takes a lot of time to generate each 2D plot frame ( about 700 milliseconds on a 1.13 MHz computer, this is a complicated plot requiring a lot of computations). So I think I should use SwingWorkers, that means a new thread for each generated graph image. There might be 1000 images to be created, and thus there might be thousands of threads in my programs. I would like to know if there is any limitation on the number of threads generated in a program so that it will be safe, or is it ok to generate as many threads as you want, as long as you follow strictly the syntax of creating threads?
    I would be thankful if someone can give me some advice.

    as there is no restriction in the Language Specification (http://java.sun.com/docs/books/jls/second_edition/html/memory.doc.html#28457) i would think it's theoretically indefinit. of course, it has a maximum because of your memory. ;-)

  • Ejb calling ejb, how many threads?

    A few of questions regarding the way WLS threads EJBs:
    1. It seems straightforward if I deploy a WLS "application" that's composed of
    a single EJB. I suppose that the app runs as a thread within the WLS JVM and "pooling"
    also makes sense.
    2. But what about an "application" that's composed of 2 EJBs, one calling the
    methods of the other. Is each EJB ran in its on thread? It seems like they would
    have to be in order to "pool" them or does the "pooling" affect the entire "application",
    i.e. you don't pool the individual beans but the entire app?
    3. How is all this affected by using local interfaces for the EJB-to-EJB method
    calls?How does this affect pooling and threading within WLS?
    Thanks.

    Hi Jack,
    "Jack Ottofaro" <[email protected]> wrote in message
    news:[email protected]..
    A few of questions regarding the way WLS threads EJBs:
    1. It seems straightforward if I deploy a WLS "application" that'scomposed of
    a single EJB. I suppose that the app runs as a thread within the WLS JVMand "pooling"
    also makes sense.It just seems because you have the question number two :)
    2. But what about an "application" that's composed of 2 EJBs, one callingthe
    methods of the other. Is each EJB ran in its on thread? It seems like theywould
    Actual EJB code runs within a thread that first began
    processing of the request. So you may have two cases.
    First, if the bean is colocated (belongs to the same jar
    or ear) with the caller, by default it will be a local call
    and the bean will run within a caller thread. Second,
    if it's remote call, it will run within "its own" thread.
    have to be in order to "pool" them or does the "pooling" affect the entire"application",
    i.e. you don't pool the individual beans but the entire app?I'm not sure I understood the question.
    3. How is all this affected by using local interfaces for the EJB-to-EJBmethod
    calls?How does this affect pooling and threading within WLS?Local interfaces buys nothing but mess. By default all calls to
    the beans residing in the same application , even if they are
    declared as EJBObjects, are optimized to be local so that
    parameters are passed by reference and are not subjects of
    serialization.
    Hope this helps.
    Regards,
    Slava Imeshev

  • How many users on router? run torrent

    I share my router and I have "off-peak" internet time 2am to 8am - I needed a script to see if I am the only user on-line so that my torrents don't suck up the other people's bandwidth...
    This works:
    #!/bin/bash
    # should torrent run?
    # using a router shared by a number of people
    # If I am the only user or it is off peak time (or other concerns) then decide whether to run torrent
    #functions
    # check who's online
    function checkingprocess {
    # start by saying there are zero users
    homeusers="0"
    echo "home users reset to zero"
    # nong (important other user) is not on
    nong="no"
    echo "nong set to no"
    # get the file with MAC addresses of people connected to wireless router
    wget http://192.168.1.1/wlclientview.cmd --http-user=USERNAME --http-password=PASSWORD
    echo "got list"
    mv ~/wlclientview.cmd ~/mybin/whoosonline
    echo "moved list"
    # check if others are on-line
    homeusers=$(grep -c "<tr>" ~/mybin/whoosonline)
    echo "counted $homeusers table rows"
    # remove extra 3 that are not useful
    homeusers=`expr $homeusers - 3`
    echo "that means we have $homeusers users (result -3)"
    # check for special case "nong"
    if grep -q "MAC:OF:USER:NONG" ~/mybin/whoosonline
    then
    # special case - Nong is online too
    nong="nong"
    echo "nong online"
    else
    echo "nong not on line"
    fi
    # report total to text file for conky to display
    echo $homeusers > /home/tawan/mybin/whoosonlinenow
    # check the time
    function timechecker {
    # off-peak internet use between 3 and 6 am
    # actually 3 to 8 but give others a chance early morning from 6
    TIME=`date +%H`
    if [ "$TIME" -ge "02" ]
    then
    mytime="offpeak"
    echo "off peak time?"
    if [ "$TIME" -le "05" ]
    then
    mytime="offpeak"
    echo "off peak time"
    else
    mytime="peak"
    echo "peak time"
    fi
    else
    mytime="peak"
    echo "peak time"
    fi
    # run
    function myrunner {
    ps aux > /tmp/ps.log
    # look in the file for this name to see if it is running
    if grep rtorrent /tmp/ps.log
    then
    appcheck
    if [ "$appkill" -ge "1" ]
    then
    echo "can't run torrent $appkill x web app open"
    else
    echo "torrent already running"
    fi
    else
    echo "run torrent"
    appcheck
    if [ "$appkill" -ge "1" ]
    then
    echo "can't run torrent $appkill x web app open"
    else
    urxvt -g 46x1 -title rtorrent -e rtorrent -o http_capath=/etc/ssl/certs &
    fi
    fi
    # kill
    function mykiller {
    ps aux > /tmp/ps.log
    # look in the file for this name to see if it is running
    if grep rtorrent /tmp/ps.log
    then
    killall rtorrent &
    fi
    echo "kill torrent"
    # app check
    function appcheck {
    appkill="0"
    # skype - kill torrents if skype in use
    myapp="skype"
    appkiller
    # chromium - kill torrents if chromium in use
    myapp="chromium"
    appkiller
    # firefox - kill torrents if firefox in use
    myapp="swiftfox"
    appkiller
    # app killer
    function appkiller {
    if grep $myapp /tmp/ps.log
    then
    mykiller
    echo "killed because of $myapp"
    appkill=`expr $appkill + 1`
    fi
    # think about it all
    function mythinker {
    # in peak time we run if you are the only user
    # in off peak time we run even with other users
    # unless that user is nong and so we kill later
    # always kill if nong is on-line
    if [ "$nong" = "nong" ]
    then
    echo "nong on-line so kill torrent"
    mykiller
    else
    if [ "$mytime" = "offpeak" ]
    then
    echo "....off peak time. Let's run torrent"
    myrunner
    else
    if [ $homeusers -le 1 ]
    then
    echo "....peak time and think only user is you so run torrent"
    myrunner
    else
    echo "....peak time and other users on-line so kill torrent"
    mykiller
    fi
    fi
    fi
    #end functions
    #loop
    while [ 1 ]
    do
    echo "start of loop"
    # run the above functions and loop
    checkingprocess
    timechecker
    mythinker
    echo "done functions, will sleep"
    sleep 20s
    echo "end of loop"
    done
    #end loop
    edit : improved
    Last edited by tawan (2010-07-25 07:05:20)

    QoS means Quality of Service.  Basically it reorders or delays packets depending on priority, so that time-sensitive packets always go first, and unimportant packets like bittorrent can be delayed until there is no other traffic being sent.  What I specifally was suggesting here is that your use it to lower the priority of bittorrent traffic, so that you can run it all the time but it only uses spare bandwidth that isn't being used by any other service.
    The only catch most routers can only do QoS on inbound connections which is mainly helps latency and not download speeds.  However, if your router is running linux it may have that ability.  Also look for the 'tc' utility or maybe you can install trickle.
    This thread has little bit more info.
    Last edited by xenobrain (2010-07-20 14:11:50)

Maybe you are looking for

  • Turning off tunes in iTunes 11 you no longer wish to listent to it.

    The new iTunes 11 is great, but how do you turn off a tune if you no longer wish to listen to it. The only way I found to do so is to go to controls and then  click stop. I'm sure there is another way of stopping but I haven't found it. I'd be gratef

  • How do I clone an external hard drive in Mountain Lion?

    How do I use Disk Utitlity do clone a 1TB G-Drive to another G-drive same size. I tried using Disk Utility and Restore, but it failed. The new drive is brand new. Do I need to create an image, or if it is already formatted for Mac, is this unnecessar

  • PDF acceleration F5 BigIP WA and double byte characters

    We have been trying to use the F5 appliance from BigIP to accelerate the delivery of PDF files from SharePoint over the WAN.  However, we encountered problems with the double-byte files many months ago and have been trying to resolve the problem with

  • ALV hirarchial report - Printing.

    Hi, When number of items excceds the page, header details has to print once again  in new page while the report print. can any bopdy tell me, how i can do this. Regards, Sri

  • Are Lenovo ThinkPads still reliable?

    I used to be a ThinkPad fan: I need my laptop for work, I'm a heavy user, and more important than anything is that it be indestructible.  ThinkPads used to be this. But I've heard that to no longer be the case.  Browsing this forum, it seems the rumo