Skip to content

os.totalmem() incorrect when called on container (LXD)Β #27170

Description

@voxsoftware

os.totalmem() reports an invalid value when use on a continaer - tested on lxd -
How reproduce:

apt install lxd 
lxd init 
# .....

lxc launch ubuntu:18.04 machine1
lxc config set machine1 limits.memory 2500MB
lxc exec machine1 /bin/bash

# install node ......
node 
> os.totalmem()
32xxxxxxxxxx // 32GB 
# result here is the total memory of host no the container

htop shows the correct value
good htop

Activity

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

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