Skip to content

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

Closed
@voxsoftware

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

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