Resolved Not detecting all of RAM

Discussion in 'Support' started by Wolfgange, Feb 24, 2014.

  1. Wolfgange

    Wolfgange Member

    Cervator edit: This was later fixed in the Launcher

    When I use the Terasology launcher (latest stable) under options, the maximum and initial ram have a max value of 1GB even though I have 8GB. Under Linux it detects 7 which is about correct, but under Windows 8.1 it only detects 1. Both OS's are 64 bit and in the windows control panel it detects 8GB. Is there any way I can use all of my RAM?
  2. Cervator

    Cervator Project Lead and Community Wizard Staff Member

    Interesting! You might want to file this as an issue on the Launcher issue tracker and include a screenshot or two :)
  3. mkalb

    mkalb Active Member

    We us this code:

    private void populateHeapSize() {
    long max = 512;
    final OperatingSystemMXBean osBean = ManagementFactory.getOperatingSystemMXBean();
    if (osBean instanceof {
    max = (( osBean).getTotalPhysicalMemorySize() / 1024 / 1024;
    max = Math.max(max, 512);
    // detect 32 or 64 bit OS
    final String arch = System.getProperty("os.arch");
    final boolean bit64 = arch.contains("64");
    final List<JavaHeapSize> heapSizes = JavaHeapSize.getHeapSizes(max, bit64);
    for (JavaHeapSize heapSize : heapSizes) {
  4. Wolfgange

    Wolfgange Member

    Would it be possible to add an option to manually set parameters in the case that it detects it wrong?
  5. Cervator

    Cervator Project Lead and Community Wizard Staff Member

    I'm kinda surprised we bother checking for available memory at all? Rather than just pass the memory parameter blindly :)

    Maybe it would be nice to estimate a good starting value based on the system, but leave the selected memory options wide open?
    • Agree Agree x 1
  6. mkalb

    mkalb Active Member

    Wolfgange As far as I know you have java skills. Can you write a little test class and analyse the problem with Windows 8.1, please.
  7. Skaldarnar

    Skaldarnar Badges badges badges badges mushroom mushroom! Staff Member

    How does Java/the OS handle if you assign a value that's higher than your physical RAM? Can there be complication if all of the available RAM is allocated? If that should be the case, I would advice to make this some kind of advanced option.
  8. Wolfgange

    Wolfgange Member

    When I add the argument when running the Terasology binary from the commandline, "-xms128GB -xmx128GB" (and I only have 8 GB) it gives no extra error, not even in the command prompt. Is this the correct argument I should add when executing Terasology?

    And I'm assuming most to all modern OS's should and/or java should correctly handle too much RAM allocation considering I've run Terasology with all of my RAM and max view distance and it only got really laggy.
    • Like Like x 1
  9. mkalb

    mkalb Active Member

    You need to add "-Xms128g -Xmx128g".

    Old java versions didn't run, if you don't have enough RAM. I tested it with Java 7 (Windows 64 Bit, Oracle). It was possible to start the JVM, but it begins to reserve memory (about 5 MB per second).
  10. eldoraman

    eldoraman New Member

    You can increase to 4GB on a 32 bit system. If you're on a 64 bit system you can go higher. No need to worry if you've chosen incorrectly, if you ask for 5g on a 32 bit system java will complain about an invalid value and quit.

    • Old Old x 1

Share This Page