process CPU time


 
Thread Tools Search this Thread
Operating Systems Solaris process CPU time
# 1  
Old 09-22-2011
process CPU time

We are using JAVA program and strange thing is it takes 100% CPU when not in use.

The program function is to stream a file on output port (one direction). It checks one directory and when there is a file in it, starts.

While it is streaming the CPU usage is normal, about 20%.

But, if there is nothing to do, it takes all available CPU.

What could it be?
Thanks.
# 2  
Old 09-22-2011
Poor coding ?
This User Gave Thanks to jlliagre For This Post:
# 3  
Old 09-22-2011
hm, yes, probably. software version is 1.0
but its quite expensive, and I'm not sure if we can ask for update.

I was hoping there were some easy fix, or perhaps that maybe sometimes Solaris reports 100% usage even if it isn't. (server worked for months under such load) so that we could simply ignore it.
# 4  
Old 09-22-2011
Most certainly bad programming from your description. This program IMO checks the directory continuously, without a delay for the required file, instead of checking every second, or waiting for an OS trigger. And no, you can't add that functionality afterwards.

But if it's so expensive, instead of asking for an update demand it, as this is certainly a bug.
This User Gave Thanks to pludi For This Post:
# 5  
Old 09-22-2011
If you are ready for hacks as workaround, it would probably be easy to slow down your process when it has nothing to process. There would be several approaches to do it like an interposing library or a dtrace script.
# 6  
Old 09-22-2011
If you can have any sort of return code when the file(s) are uploaded, you could write a simple script that kills the program once a file is uploaded. Then build a cronjob that starts it every minutes if it is not already running.

Dirt cheap and gets things done faster then a monkey coder.
# 7  
Old 09-22-2011
Quote:
Originally Posted by jlliagre
If you are ready for hacks as workaround, it would probably be easy to slow down your process when it has nothing to process. There would be several approaches to do it like an interposing library or a dtrace script.
It can also be done fairly easily with projects.
This User Gave Thanks to bartus11 For This Post:
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

[Linux] How much time a process waited for CPU?

Hi, Is it possible in Linux to find out how much time a process waited for CPU? In Solaris we can see it in prstat. Thanks (1 Reply)
Discussion started by: sant
1 Replies

2. Emergency UNIX and Linux Support

CPU and memory utilization of a process, by process name

Can someone please help me with a script that will help in identifying the CPU & memory usage by a process name, rather than a process id.This is to primarily analyze the consumption of resources, for performance tweaking. G (4 Replies)
Discussion started by: ggayathri
4 Replies

3. UNIX Desktop Questions & Answers

Automatically killing a process if it doesn't use any CPU time

Hi, I'm new to Linux. I have a windows server that run many processes on it. In some cases the processes doesn't exit properly or just stop working and the process needs to be killed. I was wondering how i can automatically (couple of times a day) check which process doesn't use any CPU... (3 Replies)
Discussion started by: ramikom
3 Replies

4. Shell Programming and Scripting

what would a script include to find CPU's %system time high and user time high?

Hi , I am trying to :wall: my head while scripting ..I am really new to this stuff , never did it before :( . how to find cpu's system high time and user time high in a script?? thanks , help would be appreciated ! :) (9 Replies)
Discussion started by: sushwey
9 Replies

5. UNIX Desktop Questions & Answers

Killing a process if it is not using any cpu time

Hi i am a newbie thanks in advance i have a process which keeps on running but doesn't use any CPU time and doesn't do the functionality which it is suppose to do . If i kill the process and start the process again then the process kicks in and starts using CPU time and continues to do its... (3 Replies)
Discussion started by: nick1982
3 Replies

6. Shell Programming and Scripting

How to calculate time difference between start and end time of a process!

Hello All, I have a problem calculating the time difference between start and end timings...! the timings are given by 24hr format.. Start Date : 08/05/10 12:55 End Date : 08/09/10 06:50 above values are in mm/dd/yy hh:mm format. Now the thing is, 7th(08/07/10) and... (16 Replies)
Discussion started by: smarty86
16 Replies

7. Shell Programming and Scripting

Why CPU time is longer than Elasped time?

I thought a program's elapsed time, some program language call it real time, should be the time of a program from start to finish. And it should be equal or longer than CPU time. This is true for the most of the cases. However, I do see some of my programs CPU time is longer than Elapsed time. ... (1 Reply)
Discussion started by: visio2000
1 Replies

8. UNIX for Advanced & Expert Users

how to know which process consume CPU time more

Hi, I have problem like everyday i have to check which process consuming more cpu time. I have done it manually using top command.. Is there any script which will tell the exact process name which will consuming more time. I am using hpux. (1 Reply)
Discussion started by: rajesh08
1 Replies

9. UNIX for Dummies Questions & Answers

how to get persistant cpu utilization values per process per cpu in linux (! top,ps)

hi, i want to know cpu utilizatiion per process per cpu..for single processor also if multicore in linux ..to use these values in shell script to kill processes exceeding cpu utilization.ps (pcpu) command does not give exact values..top does not give persistant values..psstat,vmstat..does njot... (3 Replies)
Discussion started by: pankajd
3 Replies

10. UNIX for Dummies Questions & Answers

how to Decrease priority of a particular process in time of process creation

how to decrease priority of a particular process in time of process creation... and also how to decrease priority of a particular process after process creation.. can any one please help me out... (2 Replies)
Discussion started by: Ramkum
2 Replies
Login or Register to Ask a Question