[Bug 15751] New: `time` function reports more `maxrss` usage than GNU time

bugzilla at busybox.net bugzilla at busybox.net
Thu Aug 31 09:28:05 UTC 2023


https://bugs.busybox.net/show_bug.cgi?id=15751

            Bug ID: 15751
           Summary: `time` function reports more `maxrss` usage than GNU
                    time
           Product: Busybox
           Version: 1.34.x
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P5
         Component: Other
          Assignee: unassigned at busybox.net
          Reporter: herano1999 at gmail.com
                CC: busybox-cvs at busybox.net
  Target Milestone: ---

use the binary from this C++ file produces:

```
// add.cpp
#include <cstdio>

char bulk[1 << 20];

int main()
{
        for (int i = 1; i < 1048576; i++) bulk[i] = bulk[i - 1] + 'a';
        printf("hello, world\n");
        return 0;
}
```

and compile it with

```
g++ add.cpp -o add -O2 -static
```

using GNU time 1.7 to monitor the usage

```
/usr/bin/time -v ./add
```

it reports that `add` uses ~1800 kbytes of maxrss, but uses busybox 1.34.1

```
time -v ./add
```

it reports that `add` uses ~7300 kbytes of maxrss. It's rather 4x more than the
GNU time gives. I think there should not be too much gap between the two `time`
functions.

-- 
You are receiving this mail because:
You are on the CC list for the bug.


More information about the busybox-cvs mailing list