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

Use Getpagesize replace hard-coded page size #76

Merged
merged 1 commit into from
Jun 17, 2024

Conversation

zhengtianbao
Copy link
Contributor

The process_resident_memory_bytes use 4096 as hard-coded page sizes on all architectures, some of which are probably not right. Use os.Getpagesize() instead. This could fix issue: VictoriaMetrics/VictoriaMetrics#6457

Copy link
Contributor

@AndrewChubatiuk AndrewChubatiuk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should be valid for linux

Copy link
Contributor

@f41gh7 f41gh7 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@f41gh7 f41gh7 merged commit 464c46d into VictoriaMetrics:master Jun 17, 2024
1 check passed
valyala added a commit that referenced this pull request Jul 16, 2024
…riteProcessMetrics() call

It is enough to detect OS page size at the start and then use the detected value.
This removes syscall overhead from every writeProcessMetrics() call.

This is a follow-up for 7b14975
Updates #76
Updates VictoriaMetrics/VictoriaMetrics#6457
@valyala
Copy link
Contributor

valyala commented Jul 16, 2024

@zhengtianbao , @f41gh7 , @AndrewChubatiuk , please see the follow-up commit eba0da0

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

Successfully merging this pull request may close these issues.

4 participants