@@ -2306,14 +2306,14 @@ bool os::Linux::query_process_memory_info(os::Linux::meminfo_t* info) {
2306
2306
info->rssanon = info->rssfile = info->rssshmem = -1 ;
2307
2307
if (f != nullptr ) {
2308
2308
while (::fgets (buf, sizeof (buf), f) != nullptr && num_found < num_values) {
2309
- if ( (info->vmsize == -1 && sscanf (buf, " VmSize: " SSIZE_FORMAT " kB" , &info->vmsize ) == 1 ) ||
2310
- (info->vmpeak == -1 && sscanf (buf, " VmPeak: " SSIZE_FORMAT " kB" , &info->vmpeak ) == 1 ) ||
2311
- (info->vmswap == -1 && sscanf (buf, " VmSwap: " SSIZE_FORMAT " kB" , &info->vmswap ) == 1 ) ||
2312
- (info->vmhwm == -1 && sscanf (buf, " VmHWM: " SSIZE_FORMAT " kB" , &info->vmhwm ) == 1 ) ||
2313
- (info->vmrss == -1 && sscanf (buf, " VmRSS: " SSIZE_FORMAT " kB" , &info->vmrss ) == 1 ) ||
2314
- (info->rssanon == -1 && sscanf (buf, " RssAnon: " SSIZE_FORMAT " kB" , &info->rssanon ) == 1 ) || // Needs Linux 4.5
2315
- (info->rssfile == -1 && sscanf (buf, " RssFile: " SSIZE_FORMAT " kB" , &info->rssfile ) == 1 ) || // Needs Linux 4.5
2316
- (info->rssshmem == -1 && sscanf (buf, " RssShmem: " SSIZE_FORMAT " kB" , &info->rssshmem ) == 1 ) // Needs Linux 4.5
2309
+ if ( (info->vmsize == -1 && sscanf (buf, " VmSize: %zd kB" , &info->vmsize ) == 1 ) ||
2310
+ (info->vmpeak == -1 && sscanf (buf, " VmPeak: %zd kB" , &info->vmpeak ) == 1 ) ||
2311
+ (info->vmswap == -1 && sscanf (buf, " VmSwap: %zd kB" , &info->vmswap ) == 1 ) ||
2312
+ (info->vmhwm == -1 && sscanf (buf, " VmHWM: %zd kB" , &info->vmhwm ) == 1 ) ||
2313
+ (info->vmrss == -1 && sscanf (buf, " VmRSS: %zd kB" , &info->vmrss ) == 1 ) ||
2314
+ (info->rssanon == -1 && sscanf (buf, " RssAnon: %zd kB" , &info->rssanon ) == 1 ) || // Needs Linux 4.5
2315
+ (info->rssfile == -1 && sscanf (buf, " RssFile: %zd kB" , &info->rssfile ) == 1 ) || // Needs Linux 4.5
2316
+ (info->rssshmem == -1 && sscanf (buf, " RssShmem: %zd kB" , &info->rssshmem ) == 1 ) // Needs Linux 4.5
2317
2317
)
2318
2318
{
2319
2319
num_found ++;
@@ -2361,15 +2361,15 @@ void os::Linux::print_process_memory_info(outputStream* st) {
2361
2361
// rss its components if the kernel is recent enough.
2362
2362
meminfo_t info;
2363
2363
if (query_process_memory_info (&info)) {
2364
- st->print_cr (" Virtual Size: " SSIZE_FORMAT " K (peak: " SSIZE_FORMAT " K )" , info.vmsize , info.vmpeak );
2365
- st->print (" Resident Set Size: " SSIZE_FORMAT " K (peak: " SSIZE_FORMAT " K )" , info.vmrss , info.vmhwm );
2364
+ st->print_cr (" Virtual Size: %zdK (peak: %zdK )" , info.vmsize , info.vmpeak );
2365
+ st->print (" Resident Set Size: %zdK (peak: %zdK )" , info.vmrss , info.vmhwm );
2366
2366
if (info.rssanon != -1 ) { // requires kernel >= 4.5
2367
- st->print (" (anon: " SSIZE_FORMAT " K , file: " SSIZE_FORMAT " K , shmem: " SSIZE_FORMAT " K )" ,
2367
+ st->print (" (anon: %zdK , file: %zdK , shmem: %zdK )" ,
2368
2368
info.rssanon , info.rssfile , info.rssshmem );
2369
2369
}
2370
2370
st->cr ();
2371
2371
if (info.vmswap != -1 ) { // requires kernel >= 2.6.34
2372
- st->print_cr (" Swapped out: " SSIZE_FORMAT " K " , info.vmswap );
2372
+ st->print_cr (" Swapped out: %zdK " , info.vmswap );
2373
2373
}
2374
2374
} else {
2375
2375
st->print_cr (" Could not open /proc/self/status to get process memory related information" );
0 commit comments