When any of the memory usage values exceeds 2 147 483 648, on my system it gets generated in the JSON file as a negative integer.
This is a normal behavior for sprintf when called with %d : the argument is treated as an integer and presented as a signed decimal number.
You should replace %d with %lu : long unsigned decimal number.
%ld is a working replacement too, but since those values can't be negative...
When any of the memory usage values exceeds 2 147 483 648, on my system it gets generated in the JSON file as a negative integer. This is a normal behavior for sprintf when called with %d : the argument is treated as an integer and presented as a signed decimal number. You should replace %d with %lu : long unsigned decimal number. %ld is a working replacement too, but since those values can't be negative...