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

retrieveLinuxMemoryStats() does not report the memory limits set by containers/cgroup #7453

Open
mpirvu opened this issue Sep 5, 2024 · 1 comment

Comments

@mpirvu
Copy link
Contributor

mpirvu commented Sep 5, 2024

retrieveLinuxMemoryStats(struct OMRPortLibrary *portLibrary, struct J9MemoryInfo *memInfo) calls retrieveLinuxCgroupMemoryStats(portLibrary, &cgroupMemInfo); to determine the memory limits set by containers.
I have observed that retrieveLinuxCgroupMemoryStats() returns an error code and therefore retrieveLinuxMemoryStats() will only report the memory available on the host.
Additional tracing showed that retrieveLinuxCgroupMemoryStats() is actually able to determine the cgroup memory limits, but it fails when trying to determine the swapiness:

	rc = readCgroupSubsystemFile(portLibrary, OMR_CGROUP_SUBSYSTEM_MEMORY, CGROUP_MEMORY_SWAPPINESS, numItemsToRead, "%" SCNu64, &cgroupMemInfo->swappiness);
	if (0 != rc) {
		goto _exit;
	}

Maybe the code should not abort immediately and provide whatever partial information was able to gather correctly.

@mpirvu
Copy link
Contributor Author

mpirvu commented Sep 5, 2024

@babsingh Could you please comment on this issue? Thanks

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

No branches or pull requests

2 participants