cloudfoundry / cloudfoundry/diego-release

Show memory usage independent of the used memory limit

Open
#1,053 4 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
Go
Stars
206
Forks
228
Avg merge
1d 19h
Merged PRs (30d)
9

Description

Current behavior

Currently, the shown memory metric is influenced by the memory limit which leads to confusing behaviors.

App used to reproduce: https://github.com/cloudfoundry/cf-acceptance-tests/tree/develop/assets/binary

cf push 200 -b binary_buildpack --random-route -m 200M
cf app 200
...
memory usage:   200M
     state     since                  cpu    memory          disk         logging             cpu entitlement   details
#0   running   2025-10-02T15:03:49Z   1.6%   15.5M of 200M   6.4M of 1G   0B/s of unlimited   40.9%
cf push 20 -b binary_buildpack --random-route -m 20M
cf app 20
...
memory usage:   20M
     state     since                  cpu    memory        disk         logging             cpu entitlement   details
#0   running   2025-10-02T15:08:14Z   1.6%   4.9M of 20M   6.4M of 1G   0B/s of unlimited   79.7%
cf push 5 -b binary_buildpack --random-route -m 5M
cf app 5
...
memory usage:   5M
     state     since                  cpu    memory       disk         logging             cpu entitlement   details
#0   running   2025-10-02T15:10:40Z   1.7%   1.5M of 5M   6.4M of 1G   0B/s of unlimited   87.8%
cf push 2 -b binary_buildpack --random-route -m 2M
cf app 2
...
memory usage:   2M
     state     since                  cpu    memory         disk         logging             cpu entitlement   details
#0   running   2025-10-02T15:11:36Z   1.5%   660.7K of 2M   6.4M of 1G   0B/s of unlimited   78.2%
cf push 1 -b binary_buildpack --random-route -m 1M
cf app 1
...
memory usage:   1M
     state     since                  cpu    memory         disk         logging             cpu entitlement   details
#0   running   2025-10-02T15:12:49Z   1.7%   328.7K of 1M   6.4M of 1G   0B/s of unlimited   88.7%

Due to a bug in the cli, this cannot be continued, but I think the problem is clear. How much memory does the app consume ~15MB or ~300KB?

The problem is caused by a sidecar being added with a limit of 64MB.

Desired behavior

It would be great to see the memory the app actually consumes.

Affected Version

2.121.0

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the reported behavior with the listed cf push and cf app commands, comparing memory output under different limits and with the 64MB sidecar. Trace how the app and sidecar memory values are combined or displayed. Done means the reported metric reflects the app's actual consumption independently of the configured memory limit, with the affected output cases covered.

Written by the indexing model from the issue text.

Assessment

Tech stack
go
Domain
backend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.