Skip to content

os.totalmem() missleading output in docker-container with memory-limit #51095

@the-hotmann

Description

@the-hotmann

Version

v18.17.0

Platform

Linux wikijs 6.5.0-5-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.5.13-1 (2023-11-29) x86_64 Linux

What steps will reproduce the bug?

Use any NodeJS Dockercontainer and limit its memory down to any number.
Now check `os.totalmem()` - it will still report the whole memory of the VM/Machine, not the limited memory of the container, but it should report the total available Memory, which in a memory limited container is not the whole Memory of the machine.

How often does it reproduce? Is there a required condition?

Everytime

What is the expected behavior? Why is that the expected behavior?

VM = 12GB RAM
Docker container = 300MB RAM

When I run `os.totalmem()` in the docker-container it reports 12GB RAM.

What do you see instead?

requarks/wiki#6863

Metadata

Metadata

Assignees

No one assigned

    Labels

    libuvIssues and PRs related to the libuv dependency or the uv binding.osIssues and PRs related to the os subsystem.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions