diff --git a/doc/notes/3.1.3.md b/doc/notes/3.1.3.md index 8d27c3e7eb..8c35f088aa 100644 --- a/doc/notes/3.1.3.md +++ b/doc/notes/3.1.3.md @@ -50,6 +50,10 @@ This build includes the following changes: * Callback and struct classes. * Struct members. * Function parameters and return values. +- The default memory allocator on Windows is now the system allocator instead of jemalloc. + * jemalloc is not properly optimized for Windows and its performance is not competitive. + * jemalloc is still a major performance win on Linux and macOS. + * rpmalloc is faster on all platforms but requires per-thread setup, so must be enabled manually. #### Fixes diff --git a/modules/core/src/main/java/org/lwjgl/system/MemoryManage.java b/modules/core/src/main/java/org/lwjgl/system/MemoryManage.java index 863507ead2..173ae7600c 100644 --- a/modules/core/src/main/java/org/lwjgl/system/MemoryManage.java +++ b/modules/core/src/main/java/org/lwjgl/system/MemoryManage.java @@ -26,7 +26,7 @@ static MemoryAllocator getInstance() { return (MemoryAllocator)allocator; } - if (!"system".equals(allocator)) { + if (!((allocator == null && Platform.get() == Platform.WINDOWS) || "system".equals(allocator))) { String className; if (allocator == null || "jemalloc".equals(allocator)) { className = "org.lwjgl.system.jemalloc.JEmallocAllocator";