Uploaded image for project: 'Minecraft: Java Edition'
  1. Minecraft: Java Edition
  2. MC-123545

Memory usage shown in crash reports is misleading/incorrect

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • None
    • Minecraft 1.12.2, Minecraft 1.13.2, 1.16.5
    • None
    • Confirmed
    • (Unassigned)

      The "System Details" section of crash reports has a section on memory usage that looks like so:

      Memory: <a> bytes (<A> MB) / <b> bytes (<B> MB) up to <c> bytes (<C> MB)

      This suggests that the values for 'a' represents the amount of memory used, however, the value currently used here is actually the amount of free memory.

      See the code in CrashReport.populateEnvironment:

      Runtime runtime = Runtime.getRuntime();
      long i = runtime.maxMemory();
      long j = runtime.totalMemory();
      long k = runtime.freeMemory();
      long l = i / 1024L / 1024L;
      long i1 = j / 1024L / 1024L;
      long j1 = k / 1024L / 1024L;
      return k + " bytes (" + j1 + " MB) / " + j + " bytes (" + i1 + " MB) up to " + i + " bytes (" + l + " MB)";
      

      I think it would be better if this value showed the used memory amount (total - free), otherwise I think the text here should clarify what this value actually represents.

            Unassigned Unassigned
            quadraxis Ben Staddon
            Votes:
            5 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              CHK: