My Poor CPU Performance #117
Labels
No Label
Bug
Cleanup
documentation
Driver
duplicate
Feature
Firmware
glscopeclient
good first issue
Hardware
help wanted
invalid
Linux
performance
question
scopeserver
Windows
wontfix
No Milestone
No Assignees
1 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: AllSpice/ThunderScope#117
Loading…
Reference in New Issue
Block a user
No description provided.
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Leaving the program running for a while starts to bog down my computer to the point of affecting other programs.
Each stage of the pipeline and the 10 packet processors all are their own threads that sit idle most of the time. Each is polling for its respective input queue.
Valgrind should help narrow the biggest sinks down.
To reproduce give the test.js a while loop condition that will never be met and then just wait for things to slow down.
Reviewing the code, I had packet processors commented out while testing, so that only leaves the pipeline threads and the tight polling loop from js. Not sure how to add a delay into the js to make it less tight polling.
CPU utilization is very high. There are 10 threads, one is consuming ~115% CPU utilization. The rest are all below 10%.
Memory usage steadily climbs, so we got massive memory leaks somewhere.
Memory leakage is coming from repeated calls to GetData() by js. Likely because each call to GetData() calls malloc to create a packet to give js. Packets are only 6 bytes, but add up over time.
We need to find a way to have js explicitly release the packet. assigning a new value to the variable holding the array buffer doesn't seem to run the callback to free the memory, so it needs to be done more explicitly.
Ditching N-Api fixed this