CORBA connections not relinquished - CPU usage - 100%

We have a session bean making a corba call, however after the call is susccessful,
the connection doesn't relinquished. If We do a netstat , the number of established
connections keep increasing as more calls are made to the CORBA server. We am
facing issues of CPU usage goin upto 100% and never comes below 97% after a lot
of such calls. Please suggest someway of fixing it.

You should verify it within the product documentation.
If you want to verify it by yourself, from wls, implementing the singleton pattern
for your remote object, invoke a method on the remote object, implement a sleep
in it (on the corba server), and after try to execute another method on the same
remote object (singleton), which returns immediately (it is important that you
run this test within the same wls instance, and the same ejb (ejb module) : the
singleton is relative to the classloader).
If the orb implementation does not multiplex the invokations, you will see the
second call not returning until the first one has not returned (end of sleep time).
(of course, I suppose the Corba server is multithreaded...)
Sergi
"Nishant" <[email protected]> wrote:
>
Perfect....thanks....but isnt using singleton going to harm the performance..coz
this is old version of visibroker, and it prbably doesnt multiplex the
threads??
"Sergi Vaz" <[email protected]> wrote:
Hello,
use the ORB as a "singleton" object : do not invoke ORB.init many times,
but only
once, and after cache the corba object on a static variable.
It's thread safe, the remote invocations will be multiplexed.
So you will have only "one" reader thread for each corba object, and
you will
solve your problem.
Some vendor are not fully compliant and do not implement the destroy
method.
So you do not release the ORB resources, but keep them (it's also more
performant).
At this point you will have a "dangling" reader thread only after aredeploy
(unless
you shut down the jvm).
Sergi
"Nishant" <[email protected]> wrote:
Andy,
I am using visibroker 3.2. , and WLS 7.0 , JSK 1.3.1_08 And I do not
see a method
called org.omg.CORBA.ORB.destroy.
Is there an alternative way to achieve this??
Unless I destroy the threads the connection with the CORBA server would
remain,
and this is driving up the CPU usage, for every new connection made.
Thanks
Nishant
Andy Piper <[email protected]> wrote:
"Nishant" <[email protected]> writes:
We have a session bean making a corba call, however after the callis susccessful,
the connection doesn't relinquished. If We do a netstat , the numberof established
connections keep increasing as more calls are made to the CORBA
server.
We am
facing issues of CPU usage goin upto 100% and never comes below
97%
after a lot
of such calls. Please suggest someway of fixing it.This is most likely because you are using the JDK 1.3 ORB. It doesnot
release threads until the system exits. This is one reason why using
the BEA ORB in 8.1 is preferrable.
If you are using WLS 7.0 then Sun did make a fix in JDK 1.3.1_09 which
adds a special property to allow ORB.destroy() to release the
threads. You would have to go through support to find out what this
property is. If you are using 8.1 then you can use the BEA ORB or
if
you need to use the JDK ORB I think that calling ORB.destroy() will
release the threads for you.
Hope this helps.
andy

Similar Messages

  • Flash player 11 is very glitchy on ALL browsers and makes my CPU usage 100%,Streaming media headache

    flash player 11 is very glitchy on ALL browsers and makes my CPU usage 100%, making all youtube and pandora or any streaming media a headache, i have a low-end but good quality Emachine with Windows 7 Sv pk. 1, AMD Athalon Processor 2650e 1.6 GHz 2GB ram 32-bit, which isn't that bad, it used to play HD videos and everything without a skip or lag, it is virus clean, and clean of any large bulky programs, the only thing that went wrong was the fact that the adobe flash updates slowly but surely made it worse, AND it will not let me roll-back to an older version anymore like it used to, so WTF is up? no one seems to have an answer for this, and it seems like ADOBE is doing everything in it's power to not let me ask this question or get it solved, maybe it's because I AM TOO SMART FOR IT AND KNOW IT'S A FAILURE. so please, anyone who actually has a degree in this field is welcome, but no BS anymore, i want answers.
    [moved to Flash Player forum]
    Message was edited by: sinious

    The jump to FP11 was pretty significant with Stage3D. Now Flash Player has a lower level access to your computers GPU to offload playing video and 3d rendering to the GPU. However if your systems GPU isn't up to the task you really won't see that performance gain.
    Enter H264 video decoding. A large segment of the Flash usage market is simply viewing video. For sites without fallback in mind (or don't mind software rendering fallback), video may suffer. Using the GPU accelerated video classes may make it difficult for your system to view playback. Disabling hardware acceleration as recommended above would revert you back to software (CPU) decoding to check if your system itself is the issue (and not all the new GPU additions). You did that yet you're still having an issue.
    Just to clarify, as I have an eMachine (for accounting), your computer is very much in the "budget" margin. You have a 3 year old single core 1.6ghz AM2 CPU with 512kb of L2. That's the K8 series. This is a very underpowered, single thread loving CPU. Only the most optimized Flash sites and lower end videos (720p or below) should play, but I'm not even sure if they'll "play well". It depends on your GPU.
    Also you should know they have an official list of unsupported chipsets and drivers based on many factors. Here's a list for FP11 and AIR3:
    http://helpx.adobe.com/x-productkb/multi/stage3d-unsupported-chipsets-drivers-flash.html
    Check the bottom of the screen to see what Flash is reporting your rendering mode is. For example, mine states:
    Your gpu supports Stage3D in both Baseline and Constrained profile!
    Baseline RenderMode:
    DirectX9
    Constrained RenderMode:
    DirectX9 (Baseline Constrained)
    This probably won't get better in the future for you. Flash is not a low end multimedia runtime. It does require and utilize high end hardware in a much more reliable way.

  • CPU usage 100%

    Dear Sir,
              This is regarding laptop model compaq 6720s showing cpu usage 100% even after reinstallation of OS & even after new hard drive connected to the same done with new os installtions. So it seems that any hardware issue with motherboard either CPU (Core 2 Duo 2.0 GHz
    Regards
    Nilesh Potabatti

    Hi,
    Do you know which process is the culprit ? Please try this:
    Right click a blank space on Taskbar,
    Click Start Task Manager,
    Check in the Processes tab, which one uses high CPU and please post back.
    Regards.
    BH
    **Click the KUDOS thumb up on the left to say 'Thanks'**
    Make it easier for other people to find solutions by marking a Reply 'Accept as Solution' if it solves your problem.

  • TMG Microsoft Firewall Service Process (wspsrv.exe) high CPU. CPU Usage 100%

    TMG Microsoft Firewall Service Process (wspsrv.exe) high CPU.
    CPU Usage 100%
    Please help me.
    Thanks

    Hi,
    Since there can be multiple reasons for this issue, you can
    capture a manual dump of the wspsrv.exe process on TMG server or find some related logs to better analyze this issue firstly.
    In addition, what have you done before you encountered that issue?
    If you have any third-party programs installed, you can temporary disable them and restart the firewall service to see if the issue persists.
    For more detailed information, please refer to the links below:
    How
    to capture a manual dump of the wspsrv.exe process on TMG 2010?
    Using
    DebugDiag 1.2 to Automate Dump Analysis – TMG High CPU Utilization Scenario
    Best regards,
    Susie

  • Applet CPU usage 100%

    Hi,
    I am running my applet on IE 5.5 not using any plugin, on a NT heavy
    duty machine. The applet takes up 100% CPU. The applet does not have
    any GUI component but launches JSP pages. The applet connects to
    backend resources using socket, uses threads etc. The bulk of the code
    is in Java classes- the classes themselves run fine outside of the
    applet.
    Any ideas or suggestions welcome. How can we measure cPU usage in
    Java?
    Thanks a lot,
    Sanjay

    I too have this problem

  • CPU Usage 100%? K8N Diamond Plus

    Never before have I witnessed the CPU being used at it's absolute maximum.  It has been occuring regularily with my system.  I noticed it first when my screen saver started getting jittery.  This seems to occur most often about 1-2 minutes after windows finishes loading.  It seems kind of odd to me that this occurs during typically idle system times.  The memory usage also dramatically rises during these spikes, using ctrl+alt+delete I noticed svchost.exe to be the culprit of the memory usage atleast.  The hard drive doesn't appear to be active when these events occur.  Is this normal for this motherboard, or is this something that should be corrected?
    I've always had 3 short beeps upon startup with this board, but it has never stalled the boot process.  Anyone know what this means?
    I've upgraded my board somewhat recently and carried over the CPU and memory from a older MSI model that used the same type.  Could it be possible either or both are incompatible?
    Also one, somewhat less important problem.  First off I must say that the PS/2 power on feature is pretty cool.  I used it with a wireless keyboard so I could turn on my PC from my living room HDTV (I have my comp wired through Y/Pr/Pb cables).  Only problem is about one in every 4 or so shutdowns the system restarts immediatly when this feature is selected in the bios.  Bios issue maybe?
    System Info (and everything directly connected to it):
    (pretty sure not all of this is relevant, but I figure it couldn't hurt)
    MoBo:  MSI K8N Diamond Plus
    Memory:  1Gb (2x512 kit) Crucial PC3200 CT6464Z40B.C8TD (in slots 1 & 2)
    Processor:  Athlon 64 3200+ Winchester
    GPU (only one):  MSI NX7900GT-VT2D256E-HD (primary PCI-e)
    Modem:  SupraMax LE 56K Fax Modem (PCI)
    HDD:  WD Caviar 120Gb IDE (primary)
    HDD:  Maxtor 80Gb USB (external, non system)
    3.5:  Standard 3.5" floppy drive (a:)
    5.25:  Lite-on 48x CD burner (secondary slave)
    5.25:  Sony DVD rom (secondary master)
    PS:  Antec SmartPower 2.0 500W
    Human Interface:  Wired Logitech KB & Mouse through USB (for primary use)
    Human Interface:  Wireless Logitech KB & Mouse through PS/2 (for remote use, often turned off)
    Primary Monitor:  Viewsonic P70f 17" CRT hooked to DVI #1 via RGB adapter
    Secondary Monitor:  Sony KDL-V32XBR1 32" HDTV through 1080i Y/Pr/Pb adapter, stereo audio
    Speakers:  harman/kardon
    Connected to internet via Cat5 network, phone modem sometimes used when primary internet is down
    OS:  Windows XP Pro w/ SP 2 installed
    Thank's in advance to anyone that can help me as I'm pretty much stumped at this point.

    Quote from: mdawgmike on 11-November-06, 11:25:18
    Any other suggestions?
    how about this:
    Quote from: BOSSKILLER on 03-November-06, 23:14:30
    get Process Explorer to determinate in details what make this CPU usage: http://www.sysinternals.com/Utilities/ProcessExplorer.html
    it has more detailed information than the built-in task manager.

  • Evenlog viewing causes CPU usage 100% on Windows server 2008 SP2

    We have Windows server 2008 SP2 with strange behaviour. When I scroll down events in eventlog viewer CPU usage hits 100% and eventlog viewer freeze. CPU usage is split between 2 processes SVCHOST.EXE (lmhosts, eventlog and Dhcp services) and MMC.EXE.
    1)I tried to replace eventlog files with new ones. That didn’t helped
    2)After server clean boot problem still exist.
    3)When CPU hits 100% usage process explorer shows that from SVCHOST.EXE process CPU is used by service EventLog.
    Any ideas how to fix this?

    Hi Santosh
    I re-installed VMware
    tools and also configured VMXNET 3 - nothing changed :(
    Sorry to hear that.
    Windows event log service has couple of dependencies i.e. task scheduler and windows event collector service. Can try restrating those services ?
    In addition to above, try following steps
    Change NTFS permission of  %WINDIR%\System32\WinEvt\Logs directory, add Local Service and
    Network Service, give them FULL permissions.
    Stop and Start event viewer service by running following command
    net stop eventlog && net start eventlog
    Issues like this might occur if the disk (FC or iSCSI SAN or even NAS) has some inconsistencies , this is true in case of both physical and virtual machines 
    You might want to try running chkdisk as well on the server in question
    http://technet.microsoft.com/en-us/library/cc730714(v=ws.10).aspx
    If nothing helps, try inplace upgrade of the Operating system as an last option.
    How to Perform an In-Place Upgrade on Windows Vista, Windows 7, Windows Server 2008 & Windows Server 2008 R2
    http://support.microsoft.com/kb/2255099
    Thanks
    Regards, Santosh
    I do not represent the organisation I work for, all the opinions expressed here are my own.
    This posting is provided "AS IS" with no warranties or guarantees and confers no rights.
    Whenever you see a helpful reply, click on Vote As Helpful & click on
    Mark As Answer if a post answers your question.

  • ASA not showing CPU Usage

    HI,
    I was polling my ASA on OP manager which was reside on INSIDE zone now we move OP manager on DMZ. Now ASA not showing ACTIVE CONNECTION and CPU Usage in OP manager.
    below are snmp configuration.
    snmp-server host DMZ A.B.C.D community cisco version 2c
    snmp-server enable traps
    snmp-server community cisco
    and recieve a mention log on ASA during polling ASA on OP manager (NMS).
    Kindly advice in this regards.
    Regards,
    Arshad Ahmed

    Any one kindly reply

  • NIScope CPU usage 100% when waiting for trigger

    Hello, I'm using a NI 5102 DAQ card and want to acquire single bursts. However when the Multi Fetch.vi is waiting for a trigger (and this can be up to a minute) the CPU usage goes up to 100 %. Is there any way to overcome this?
    Attachments:
    Current_ProjectSWEEP2withoutAgilentNEWScopeWrite_to_FilePOSTED.vi ‏98 KB
    ScopeSUB.vi ‏108 KB

    Yea, Ive noticed the same thing.  The niSope dll in the Fetch.vi grabs 100% CPU if timeout is larger than 1 or 2 seconds. 
    Has anyone talked to NI about this?  The problem is in that dll which is polling the PCI Scope Card.  That dll is not giving back any CPU if it waits for more than a second or two.
    John Dailing
    [email protected]

  • Overheating,fan broken, running extremely slow, cpu usage 100%

    whist playing an online game my toshiba laptop suddenly started lagging, it didn't shut down ( as you would expected when a laptop overheats) but the fan has completely stopped working. the cpu usage is at 100%. i've run disk clean-up, defrag , downloaded all my driver up-dates, run anti-virus software. pretty much everything but wiped the computer. will a new fan put the computer back at normal speed?

    Hi,
    Welcome to HP forum. You've posted to a wrong forum from vendor view and from machine view (this is a desktop forum). Anyway we are here to help. Your idea is having a new fan, this may or may not help. The main thing is to keep machine cooler. These are few tips.
       http://mobileoffice.about.com/od/laptopstabletpcs/qt/how-to-make-a-hot-laptop-cooler.htm
    My tip: Don't play intensive graphics games, your machine is NOT a game machine.
    Regards,
    BH
    **Click the KUDOS thumb up on the left to say 'Thanks'**
    Make it easier for other people to find solutions by marking a Reply 'Accept as Solution' if it solves your problem.

  • [Solved] cpu usage 100%, it is bug of lxpanel

    My archlinux is on an old PIII machine.  Recently, I found its CPU usage is 100%.
    But, I don't know how to solve it.  I can not found out which is cpu eater.
    vmstat is 0 idle, but on top view, there are a few process with lower cpu usage.
    I've tried both kernel, both cause 100% cpu usage.
    kernel26 2.6.37.5-1
    kernel26-lts 2.6.32.36-1
    # vmstat 2 10
    procs -----------memory---------- ---swap-- -----io---- -system-- ----cpu----
    r  b   swpd   free   buff  cache   si   so    bi    bo   in   cs us sy id wa
    1  0      0 103060  26496 227192    0    0    52    38  202  425 56 41  1  3
    4  0      0 103300  26496 227196    0    0     0     0  192  439 54 47  0  0
    1  0      0 103300  26496 227196    0    0     0     0  303  589 64 36  0  0
    1  0      0 103316  26496 227196    0    0     0     0  367  656 64 37  0  0
    # top - 22:37:53 up 52 min,  2 users,  load average: 2.46, 1.87, 1.80
    Tasks:  81 total,   2 running,  79 sleeping,   0 stopped,   0 zombie
    Cpu(s): 57.9%us, 41.1%sy,  0.0%ni,  0.0%id,  0.0%wa,  1.0%hi,  0.0%si,  0.0%st
    Mem:    495416k total,   385172k used,   110244k free,    25784k buffers
    Swap:        0k total,        0k used,        0k free,   224916k cached
      PID USER      PR  NI  VIRT  RES  SHR S %CPU %MEM    TIME+  COMMAND         
    1152 root      20   0 70992  20m 5976 S 14.5  4.2   1:13.63 X               
    23680 dlin      20   0  109m  22m  13m S  7.2  4.6   1:43.47 chromium         
    1887 dlin      20   0  138m  12m 9848 S  6.9  2.6   0:12.89 lxterminal       
    1182 dlin      20   0 99848  11m 8904 S  3.9  2.3   2:42.20 lxpanel         
    1191 dlin      20   0  297m  43m  27m S  1.0  9.1   1:00.54 chromium         
    21399 dlin      20   0  4404 1144  888 R  0.7  0.2   0:00.02 menu-cache-gen   
        1 root      20   0  1712  608  548 S  0.3  0.1   0:17.09 init             
        4 root      20   0     0    0    0 S  0.3  0.0   0:02.20 ksoftirqd/0     
      419 root      20   0     0    0    0 D  0.3  0.0   0:02.82 usb-storage     
    1161 root      20   0  3648 1144  988 S  0.3  0.2   0:00.65 hald-addon-stor
    Last edited by dlin (2011-04-02 16:38:08)

    It seems that the problem occurs to me too! Could it be linked with libreoffice?
    I think I have permission in ~/.cache directory:
    ls -lh |grep .cache
    drwxr-xr-x 2 manu manu 4,0K 29 mars 2010 cache
    [11:21][manu@compal:~]$ ls -lh .cache
    total 36K
    drwx------ 2 manu manu 4,0K 19 oct. 15:56 dconf
    -rw-r--r-- 1 manu manu 12K 14 mars 11:52 event-sound-cache.tdb.12c7aa4c6ede9c34246c65044a475d7e.i686-pc-linux-gnu
    drwxr-xr-x 3 manu manu 4,0K 18 août 2010 geeqie
    drwx------ 3 manu manu 4,0K 22 sept. 2010 gegl-0.1
    drwxr-xr-x 2 manu manu 4,0K 12 sept. 2010 gogglesmm
    drwx------ 2 manu manu 4,0K 1 avril 19:49 menus
    drwx------ 3 manu manu 4,0K 11 déc. 18:42 vlc
    [11:21][manu@compal:~]$ ls -lh .cache/menus
    total 80K
    -rw------- 1 manu manu 38K 23 nov. 19:24 26a80813bb7494e1d982502af748aef6
    -rw------- 1 manu manu 38K 1 avril 19:49 757379b1865bb943a0541b554ffbb809
    lxpanel is linked with .cache/menus directory?
    I will try to delete .cache and see what happens!!

  • When I am in e-mail. I get the spinning color wheel. Then, when I check the activity montior, it notes high cpu usage (99%) for "Safari web content.". then I quit this process and cpu usage drops way done. but I have to log in again to my e-mail. what can

    When I am in e-mail, I sometimes get the spinning color wheel, which lock up everything. when it doesn't go away, I see on the activity monitor, that CPU usage is very high (99%), for a process calles " Safari web content'. When I click on the proccess and quite, the CPUusage goes way down. Problem is that I have to then log back in to e-mail. What can I do to eliminate this proble.  thanks

    How much FREE RAM do you have when this occurs. It's easy to tell, when it beach balls open Activity Monitor (Applications - Utilities - Activity Monitor) click the System Memory tab and note how much FREE RAM is listed. If it's 500MB or less it's time for a RAM upgrade.

  • CPU usage 100%  when WLS 10.3.3 is idle on OS X 10.6.4 (Snow Leopard)

    I've installed WLS 10.3.3 on OS X 10.6.4 and executed using the instructions in the README (including setting the MEM_ARGS).
    Upon startup, the CPU usage spikes to ( then stays ) around *104%* ( dual-core CPU ); this, of course cripples the computer to where all running applications suffer. Attempting to access the console, brings the system to it's knees. This happens even if it is the only (non-system) application running.
    We need to be able to run WLS on our local development machines (MacBook Pros from 2007-present).
    We are currently running OAS (OC4J) on the machines with out any issues (CPU usage at OAS idle = ~1.1%).
    Are there any WLS performance settings that can be adjusted to alleviate the CPU utilization issue?
    My System Info:
    Model Name:     MacBook Pro
    Model Identifier:     MacBookPro4,1
    Processor Name:     Intel Core 2 Duo
    Processor Speed:     2.4 GHz
    Number Of Processors:     1
    Total Number Of Cores:     2
    L2 Cache:     3 MB
    Memory:     4 GB
    Edited by: user8664206 on Aug 3, 2010 8:54 AM

    Thank you!
    The key was modifying the "setDomainEnv.sh" file (this file is generated using the domain GUI configuration tool).
    I added the following at the top of the script (just below the comments):
    JAVA_VENDOR="Sun"
    export JAVA_VENDOR
    I modified:
    SUN_JAVA_HOME=""
    export SUN_JAVA_HOME
    ...to be:
    SUN_JAVA_HOME="/System/Library/Frameworks/JavaVM.framework/Versions/1.6.0/Home"
    export SUN_JAVA_HOME
    Now when I execute the container, it consumes only 0.2% of the CPU.
    Thanks again,
    Jim

  • Not normal cpu usage when playing video files

    Hi guys !
    I've noticed that when playing videos (with every player , i've tried them all) there is a noticable cpu usage and with hd videos well the video is extremeley slow and unwatchable .
    I have all the gstreamer plugins installed and i'm using gnome environment .
    Does anyone know what might be the issue ?
    my xorg.conf is :
      Section "ServerLayout"
        Identifier     "X.org Configured"
        Screen      0  "Screen0" 0 0
        InputDevice    "Mouse0" "CorePointer"
        InputDevice    "Keyboard0" "CoreKeyboard"
    EndSection
    Section "Files"
        ModulePath   "/usr/lib/xorg/modules"
        FontPath     "/usr/share/fonts/misc"
        FontPath     "/usr/share/fonts/100dpi:unscaled"
        FontPath     "/usr/share/fonts/75dpi:unscaled"
        FontPath     "/usr/share/fonts/TTF"
        FontPath     "/usr/share/fonts/Type1"
    EndSection
    Section "Module"
        Load  "glx"
        Load  "dri2"
        Load  "extmod"
        Load  "dbe"
        Load  "record"
        Load  "dri"
    EndSection
    Section "InputDevice"
        Identifier  "Keyboard0"
        Driver      "kbd"
    EndSection
    Section "InputDevice"
        Identifier  "Mouse0"
        Driver      "mouse"
        Option        "Protocol" "auto"
        Option        "Device" "/dev/input/mice"
        Option        "ZAxisMapping" "4 5 6 7"
    EndSection
    Section "Monitor"
        Identifier   "Monitor0"
        VendorName   "Monitor Vendor"
        ModelName    "Monitor Model"
    EndSection
    Section "Device"
            ### Available Driver options are:-
            ### Values: <i>: integer, <f>: float, <bool>: "True"/"False",
            ### <string>: "String", <freq>: "<f> Hz/kHz/MHz"
            ### [arg]: arg optional
            #Option     "ShadowFB"               # [<bool>]
            #Option     "DefaultRefresh"         # [<bool>]
            #Option     "ModeSetClearScreen"     # [<bool>]
            Option "RenderAccel" "True"
        Identifier  "Card0"
        Driver      "nvidia"
        VendorName  "nVidia Corporation"
        BoardName   "NV43 [GeForce Go 6600]"
        BusID       "PCI:1:0:0"
    EndSection
    Section "Screen"
        Identifier "Screen0"
        Device     "Card0"
        Monitor    "Monitor0"
        SubSection "Display"
            Viewport   0 0
            Depth     1
        EndSubSection
        SubSection "Display"
            Viewport   0 0
            Depth     4
        EndSubSection
        SubSection "Display"
            Viewport   0 0
            Depth     8
        EndSubSection
        SubSection "Display"
            Viewport   0 0
            Depth     15
        EndSubSection
        SubSection "Display"
            Viewport   0 0
            Depth     16
        EndSubSection
        SubSection "Display"
            Viewport   0 0
            Depth     24
        EndSubSection
    EndSection
    Thanks in advance!
    Last edited by shak (2009-11-19 03:55:53)

    shak wrote:Also is there an easier way for mplayer to play my files , with default settings , so that i don't have to type a big command each time i want to play a video ?
    Yes. You can put all of your personal default settings in the file ~/.mplayer/config. If it doesn't already exist, just create it. On my VDPAU enabled system it looks like this:
    [default]
    vo=vdpau,xv,
    deint=4
    hqscaling=9
    vc=ffh264vdpau,ffmpeg12vdpau,ffwmv3vdpau,ffvc1vdpau,
    channels=2
    As far as subtitles go, I never use them so I have no idea.

  • Cpu usage raise to 100% in socketchannel read

    hello guys,
    i m developing one socket applicatoin in which multiple client are connected to one server socket channel..
    now in my application there is one main thread which runs continuesly and in which i m asking to one particular client for his action....
    now when i ask to client then after one another thread which read from the client socketchannel is started and continuously running until client not reply.
    this read thread raise my cpu usage to 100%.....
    so what to do.????
    overview of my code::::
    //first thread
    void run()
    askClient();
    //start receive reply thread here
    rrt = new RRT();
    rrt.start();
    //second thread run method
    void run()
    while(running)
    System.out.pritnln("Inside receive thread");
    while(Bytesread==socketchannel.read(buf) > 0)
    //if get reply stop this thread
    running = false;
    in this second thread until client not reply cpu usage raise to 100%
    I have try for sleep in second thread run method than also it is not able to stop raise in usage..
    what should i do ....
    plz help

    Your designs demands artificial blocking reads, so why not using blocking sockets anyway? After all, you've spawned a new thread just to read that, you might as well save yourself the trouble with selectors.
    On the other hands, you might want to do the right thing (TM) and switch to a non-blocking design. I side with ejp on this one, use the documentation and the web.

Maybe you are looking for

  • How to add a code TestIfElse(10) to the Main method of the Program.cs class?

    How to add a code  TestIfElse(10) to the Main method of the Program.cs class? Here is my code and I have copied from the Wiley book for Microsoft certification page 14, using System; using System.Collections.Generic; using System.Linq; using System.T

  • How to record a phone call in my iphone?

    how to record a phone call in my iphone?

  • Cmd-returning not working

    Hello, One of the few short cuts I regularly use in Safari is when viewing a page and I decide to search for something, I fill in the search bar and then hit cmd-return to open the results in a new tab. Since Safari 5.1 came out however this no longe

  • PC Card & 12" Powerbook G4???

    Does anyone know how to connect a PC Card from your wireless telephone company to the 12" Powerbook G4 being that there is NO card slot on the G4?

  • Unable to load itunes store in windows 7 64bit

    Hi, installed 10.5... on Windows 7, 64bit machine and now cannot access Itunes Store.  Appears to begin loading then stalls out.  Have tried uninstalling and reinstalling.  Tried running in compatibility mode.  Daughters laptop (same operating system