Monday, May 24, 2010

What causes my java program to use so many resources?

The program uses 100 percent of my CPU (an outdated 2 GHz Intel Celeron (not D just celeron)) and a small amount of RAM (10 MB out of my 1GB total). The program is written in java using Microsoft Visual J# .NET. I use visual J# .NET to compile it and then i run it in a cmd window. The program is a basic chatroom (client/server) program which opens uses sockets and many threads. At any given time there are about 5 threads running. If it matters the program is 404 lines long. When i am testing it i usually have 3 cmd's open (1 for a server and 2 clients) but even when i just have 1 running my CPU is at 100 %. Any help is MUCH appreciated. BTW i am pretty new to java :)

What causes my java program to use so many resources?
5 threads running means good number of light weight processes in action. so dear have u imported references or libraries? applets? it is bound 2 use tht much cpu..


No comments:

Post a Comment