Skip to content

Commit

Permalink
Fix int overflow bug in reported page cache memory when dump_configur…
Browse files Browse the repository at this point in the history
…ation=true

This has no impact on how much memory will actually be used by the page cache at runtime.
It's only about how much memory we _say_ we use for the page cache when `dump_configuration` is `true`.
  • Loading branch information
chrisvest committed Nov 6, 2015
1 parent abdb1ce commit e1713a3
Showing 1 changed file with 3 additions and 1 deletion.
Expand Up @@ -85,7 +85,9 @@ public void dumpConfiguration( StringLogger messagesLog )
long totalPhysicalMemory = totalPhysicalMemory();
String totalPhysicalMemMb = totalPhysicalMemory == -1? "?" : "" + totalPhysicalMemory / 1024 / 1024;
long maxVmUsageMb = Runtime.getRuntime().maxMemory() / 1024 / 1024;
long pageCacheMb = (calculateMaxPages( config ) * calculatePageSize( config )) / 1024 / 1024;
long maxPages = calculateMaxPages( config );
long pageSize = calculatePageSize( config );
long pageCacheMb = (maxPages * pageSize) / 1024 / 1024;
String msg = "Physical mem: " + totalPhysicalMemMb + " MiB," +
" Heap size: " + maxVmUsageMb + " MiB," +
" Page cache size: " + pageCacheMb + " MiB.";
Expand Down

0 comments on commit e1713a3

Please sign in to comment.