By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
431,795 Members | 1,250 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 431,795 IT Pros & Developers. It's quick & easy.

100 % cpu utilization

P: n/a
hi

I am testing my applet to servlet communication program using
appletviewer.
as soon as i start the applet the cpu utilization reaches to 100%.I am
using apache tomcat 4.1 application server.the os is windows 2000
professional.

the same problem occurs online as more people open there applet
(ultimately it hangs).
in servlet do we need to do something to keep cpu utilization low.

please help

Anks
Jul 17 '05 #1
Share this Question
Share on Google+
4 Replies


P: n/a
"Anks" <an*****@indiatimes.com> wrote in message
news:23**************************@posting.google.c om...
hi

I am testing my applet to servlet communication program using
appletviewer.
as soon as i start the applet the cpu utilization reaches to 100%.I am
using apache tomcat 4.1 application server.the os is windows 2000
professional.

the same problem occurs online as more people open there applet
(ultimately it hangs).
in servlet do we need to do something to keep cpu utilization low.

please help

Anks


Depends on how you have it written. If there's a loop involved for listening
for messages and you have no Thread.sleep() calls, that's your problem.
Jul 17 '05 #2

P: n/a
I am not using any loop in my servlet.For any messages all the running
applets poll after some 3 seconds to the servlet.If something has to
be stoted in database ,it is stored and the change is passed to all
other applets who are polling.(service method is executed for all
request ,so i dont require a loop here).
if I m not getting ur point please specify.

Anks

"Ryan Stewart" <za****@no.texas.spam.net> wrote in message news:<ao********************@texas.net>...
"Anks" <an*****@indiatimes.com> wrote in message
news:23**************************@posting.google.c om...
hi

I am testing my applet to servlet communication program using
appletviewer.
as soon as i start the applet the cpu utilization reaches to 100%.I am
using apache tomcat 4.1 application server.the os is windows 2000
professional.

the same problem occurs online as more people open there applet
(ultimately it hangs).
in servlet do we need to do something to keep cpu utilization low.

please help

Anks


Depends on how you have it written. If there's a loop involved for listening
for messages and you have no Thread.sleep() calls, that's your problem.

Jul 17 '05 #3

P: n/a
isn't there some sort of profile option you can run
is it "java -Xprof"
that will tell you where the time is being spent

"Anks" <an*****@indiatimes.com> wrote in message
news:23**************************@posting.google.c om...
I am not using any loop in my servlet.For any messages all the running
applets poll after some 3 seconds to the servlet.If something has to
be stoted in database ,it is stored and the change is passed to all
other applets who are polling.(service method is executed for all
request ,so i dont require a loop here).
if I m not getting ur point please specify.

Anks

"Ryan Stewart" <za****@no.texas.spam.net> wrote in message

news:<ao********************@texas.net>...
"Anks" <an*****@indiatimes.com> wrote in message
news:23**************************@posting.google.c om...
hi

I am testing my applet to servlet communication program using
appletviewer.
as soon as i start the applet the cpu utilization reaches to 100%.I am
using apache tomcat 4.1 application server.the os is windows 2000
professional.

the same problem occurs online as more people open there applet
(ultimately it hangs).
in servlet do we need to do something to keep cpu utilization low.

please help

Anks


Depends on how you have it written. If there's a loop involved for listening for messages and you have no Thread.sleep() calls, that's your problem.

Jul 17 '05 #4

P: n/a
an*****@indiatimes.com (Anks) wrote in message news:<23**************************@posting.google. com>...
I am not using any loop in my servlet.For any messages all the running
applets poll after some 3 seconds to the servlet.If something has to
be stoted in database ,it is stored and the change is passed to all
other applets who are polling.(service method is executed for all
request ,so i dont require a loop here).
if I m not getting ur point please specify.

Anks

"Ryan Stewart" <za****@no.texas.spam.net> wrote in message news:<ao********************@texas.net>...
"Anks" <an*****@indiatimes.com> wrote in message
news:23**************************@posting.google.c om...
hi

I am testing my applet to servlet communication program using
appletviewer.
as soon as i start the applet the cpu utilization reaches to 100%.I am
using apache tomcat 4.1 application server.the os is windows 2000
professional.

the same problem occurs online as more people open there applet
(ultimately it hangs).
in servlet do we need to do something to keep cpu utilization low.

please help

Anks


Depends on how you have it written. If there's a loop involved for listening
for messages and you have no Thread.sleep() calls, that's your problem.


You said it was the applet causing the problem. What I was asking is
how does it know to poll every three seconds? Do you run any kind of
loop? Like:

while (appletRunning) { ... }

If so, do you have a Thread.sleep() call inside it?
Jul 17 '05 #5

This discussion thread is closed

Replies have been disabled for this discussion.