Bug 17840 - high CPU load
Summary: high CPU load
Status: RESOLVED NORESPONSE
Alias: None
Product: Runtime
Classification: Mono
Component: io-layer ()
Version: 3.2.x
Hardware: PC Linux
: --- normal
Target Milestone: ---
Assignee: Bugzilla
URL:
Depends on:
Blocks:
 
Reported: 2014-02-18 07:40 UTC by smhchf
Modified: 2016-08-29 09:29 UTC (History)
4 users (show)

Tags:
Is this bug a regression?: ---
Last known good build:

Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.


Please create a new report on GitHub or Developer Community with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:
Status:
RESOLVED NORESPONSE

Description smhchf 2014-02-18 07:40:13 UTC
I run my app in linux box (centos 6.4 x86-64) with mono 3.2.5
I found the cpu load is very high  , I use strace  -c -p 12525 command to trace what system call cause this problem
I get this result:
% time     seconds  usecs/call     calls    errors syscall
------ ----------- ----------- --------- --------- ----------------
 94.98    1.081824         229      4714           nanosleep
  1.98    0.022544           3      6485           munmap
  1.74    0.019871           1     21118           tgkill
  0.36    0.004121           6       643       321 futex
  0.31    0.003527           1      4830           poll
  0.19    0.002119           2      1064           sendto
  0.09    0.001054           0      3247           mmap
  0.09    0.001002           2       478           lseek
  0.07    0.000837           1      1418           setsockopt
  0.06    0.000739           1       836           write
  0.06    0.000738           1      1065           recvfrom
  0.05    0.000585           0      1464           stat
  0.00    0.000000           0         2           mprotect
  0.00    0.000000           0         1           sched_yield
------ ----------- ----------- --------- --------- ----------------
100.00    1.138961                 47365       321 total

I find nanosleep syscall use 94.98% cpu time
Comment 1 Zoltan Varga 2014-02-26 15:18:25 UTC
nanosleep means a thread is waiting in the kernel. it doesn't cause high cpu load.
Comment 2 Alex Rønne Petersen 2016-08-29 09:29:27 UTC
As Zoltan said, nanosleep is harmless. We need a lot more information to be able to tell you what is wrong here - if you are in fact seeing 100% CPU usage, as opposed to time spent sleeping in a system call. Since there hasn't been any activity on this bug since 2014, I'll close it, but feel free to reopen with more information (in particular, a sample app would be helpful).