Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

High CPU usage when no data input #18

Closed
cyhasuka opened this issue May 16, 2023 · 2 comments
Closed

High CPU usage when no data input #18

cyhasuka opened this issue May 16, 2023 · 2 comments

Comments

@cyhasuka
Copy link
Contributor

Hello,
Thank you for sharing such a wonderful job. I have a question now, it seems that the program also consumes a large amount of CPU resources without data input (with one CPU core consistently occupying 100%). Why is this? Is there a way to reduce CPU usage? (CPU: I7-7800k, no data input occupation: 12%, input point cloud scale 45312 pts: 14%)
Thank you and look forward to your answer!

@cyhasuka
Copy link
Contributor Author

Hello, I would like to report the new test progress to you. In this issue, I found that the high CPU resource usage is because in demo.cpp, main function lines 69 to 72, the frequent calls to the "ros::spinOnce();", resulting in the thread lock has been in a cycle of locking and unlocking.Replacing lines 69 to 72 with "ros::spin();" resolves the issue.

@seungjae24
Copy link
Member

seungjae24 commented Jun 7, 2023

Hi @cyhasuka,

Thank you for finding a great improvement~ I merged your pull request just now. Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants