Questions tagged [cpu-usage]

CPU usage indicate how much of a workload is being handled by the CPU.

CPU-usage or CPU time is the amount of time for which a central processing unit (CPU) was used for processing instructions of a computer program.

CPU time accounting :http://public.dhe.ibm.com/software/dw/linux390/perf/CPU_time_accounting.pdf

2881 questions
1
vote
0 answers

Java gif image consuming CPU and memory

in my application i do intensive use of animated gif images displayed in a JEditorPane (this is a chat). Now i realyzed that the GIFs consume a lot of CPU (near 100% in some cases), and the memory used continued to increase indefinitely. How to…
Laphroaig
  • 619
  • 4
  • 12
  • 26
1
vote
0 answers

macOS WindowServer and CoreGraphics API usage

I work on a macOS app which uses the CoreGraphics APIs to retrieve the whole screen as an image, or the various windows of an application. This is for a screen sharing feature. We occasionally run into an issue where Apple's WindowServer process…
LarryW
  • 89
  • 9
1
vote
4 answers

C: Does value return from the function take more CPU cycles than void?

If using a void function in C versus a function that returns an arbitrary type (say int), will int function take more CPU cycles than a void function? Example: int a, b = 1, c = 2; void f() { a = b + c; } int g() { a = b + c; return…
ZenJ
  • 313
  • 3
  • 15
1
vote
1 answer

How to reduce consumption of CPU in audio recording program (c++)

with help of the internet I wrote program that capture audio from microphone all time when it's running. Everything it's ok, but I need to reduce charge of CPU, because now it's about 30-35%. int SoundCapture() { const int NUMPTS = 8000 * 1; //…
dylo
  • 27
  • 3
1
vote
0 answers

Tensorflow CPU usage >100% when the whole graph is running on GPU

I have simple tensorflow code: import tensorflow as tf from tensorflow.python.client import timeline zeros = tf.zeros(shape=(1000, 1000)) a, b = tf.while_loop( lambda a, b: a < 1000, lambda a, b: (a + 1, tf.matmul(zeros, zeros)), (0,…
1
vote
2 answers

python How to watch for Win32_Processor LoadPercentage change in wmi?

How do I watch for a LoadPercentage change event using the Win32_Processor class? import wmi c= wmi.WMI() x = [cpu.LoadPercentage for cpu in c.Win32_Processor()] Where should the watch for() method be applied so that I can know if the CPU usage has…
siva
  • 2,105
  • 4
  • 20
  • 37
1
vote
1 answer

Java get CPU usage percentage of cores

I want to get total CPU usage of all cores. I need to print something like this: Cpu 1: 33% Cpu 2: 12% Cpu 3: 66% Cpu 4: 100% I tried to use this code: OperatingSystemMXBean operatingSystemMXBean = (OperatingSystemMXBean)…
Abzelhan
  • 510
  • 1
  • 7
  • 26
1
vote
1 answer

Processing unmanageable CPU cost when a video is loaded using video library

I'm trying to do a simple think: when a button is pressed i load a video using the processing video library, each button is associated with a different video, for example button 1 with video 1, button 2 with video 2, and so on. The code works but…
Giuseppe Angora
  • 833
  • 1
  • 10
  • 25
1
vote
1 answer

Optimizing Tensorflow for a 32-cores computer

I'm running a tensorflow code on an Intel Xeon machine with 2 physical CPU each with 8 cores and hyperthreading, for a grand total of 32 available virtual cores. However, I run the code keeping the system monitor open and I notice that just a small…
Gianluca Micchi
  • 1,584
  • 15
  • 32
1
vote
0 answers

Nifi container high cpu usage

In my production environment i had a 8 core, around 40GB+ RAM server. I am seeing my docker containers were using more cpu cycles, and making other standalone deployed services slow. Ex: we had a nifi service running in a container using cpu around…
Ganesh
  • 29
  • 4
1
vote
1 answer

How can I stop facebook crawler causing high CPU usage

Hi I've recently been getting super high spikes in Apache CPU usage, Apache memory usage and MySQL memory usage. It turns out that crawlers were accessing my site at a very aggressive rate, specifically Facebook. I attempted to add a crawl delay for…
1
vote
1 answer

get cpu, disk, memory and network usage of applications running inside vm

I am trying to get cpu usage, disk io, memory usage and network usage of all applications inside a virtual machine. I googled and find that for VM wise we can get the above data using powercli or powershell. But I want to get it from application…
M. P
  • 35
  • 2
  • 9
1
vote
1 answer

Unlimiting the CPU usage from R

Is there any way to unlimit the CPU usage so my PC puts more effort in finishing a task for rapidly? At the moment the k-means algorithm is estimated to finish in about 10 days, which is something I would like to reduce.
theBotelho
  • 324
  • 1
  • 3
  • 12
1
vote
1 answer

Fine grained logging of CPU activities for a specific time interval in Linux

Is there any way I can log the CPU activities, like "time-stamp: actual activity" (like context switching, etc.)? It should be like syslog, sar or top, however with more fine grained time values (in nano seconds). Please let me know if there is a…
TheCottonSilk
  • 8,662
  • 2
  • 26
  • 37
1
vote
0 answers

Spring REST CPU usage limiting among endpoints

I have a Spring REST API. Let's say /students/122/gpa endpoint gives us GPA of the student with id=122 Let's assume that we are pre-calculating all GPA data and write into an HashMap. I don't want to query database for each request. The problem…
Denny
  • 11
  • 3