Resolved Not detecting all of RAM

#1
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?
 

Cervator

Project Lead and Community Wizard
Contributor
Design
Logistics
SpecOps
#2
Interesting! You might want to file this as an issue on the Launcher issue tracker and include a screenshot or two :)
 

mkalb

Active Member
Contributor
Logistics
#3
We us this code:

Code:
private void populateHeapSize() {
 
long max = 512;
 
final OperatingSystemMXBean osBean = ManagementFactory.getOperatingSystemMXBean();
 
if (osBean instanceof com.sun.management.OperatingSystemMXBean) {
 
max = ((com.sun.management.OperatingSystemMXBean) 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) {
 
maxHeapSizeBox.addItem(heapSize);
 
initialHeapSizeBox.addItem(heapSize);
 
}
 
updateHeapSizeSelection();
 
}
 
#4
Would it be possible to add an option to manually set parameters in the case that it detects it wrong?
 

Cervator

Project Lead and Community Wizard
Contributor
Design
Logistics
SpecOps
#5
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?
 

Skaldarnar

Badges badges badges badges mushroom mushroom!
Contributor
Art
World
SpecOps
#7
Would it be possible to add an option to manually set parameters in the case that it detects it wrong?
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
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.
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.
 

mkalb

Active Member
Contributor
Logistics
#9
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
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.

Eldo