question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Reduce max threads used by JMT-MCMT

See original GitHub issue

When doing a stress test to see how the mod would behave when the maximum amount of threads are being used, I noticed an issue with framerate. I believe this is due to too many threads being spawned, causing the render thread to have trouble running often enough and therefore tanking framerates.

A possible solution could be to set the max amount of threads to be something like this (psuedocode):

if (integratedServer) {
    Math.max(availableThreads - 2, 2);
    // use a minimum of 2 threads but a maximum of (CPU threads - 2) so that the
    // render thread, OS, JVM's JIT and GC have room to breathe.
} else {
    Math.max(availableThreads - 1, 2);
    // servers don't have a render thread and not many cores, they also usually have
    // a headless OS, so only deduct 1 from the available CPU threads to make better
    // use of the HW while still giving GC, OS, JIT and plugins room to breathe.
}

Entity MT enabled: MCMT entities enabled

Entity MT disabled: MCMT entities disabled

By the way, thank you for your efforts on this mod - it’s impressive how this mod manages to achieve so much more server-side performance compared to Vanilla with a decent amount of cores!

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

2reactions
jediminer543commented, Oct 2, 2020

I’ll look into it

I’ve currently been deep diving into trying to make patching away fast util less of a pain

And I think I’ve finally done it, which is good

Capping the threadcount is super easy so I’ll try doing that next week

And thanks for the positive feedback

0reactions
jediminer543commented, Apr 11, 2021

This functionality is implemented with paraMaxMode; so I’m closing this issue

Unless I’ve goof’d in which case someone re-open this or open a new one

Read more comments on GitHub >

github_iconTop Results From Across the Web

java - How to reduce the number of threads used by the jvm
Apart from -XX:+UseSerialGC which disables Parallel or Concurrent GC, there are the following options to reduce the number of JVM threads:.
Read more >
MCMT - Mods - Minecraft - CurseForge
This is a mod, that multithreads minecraft's tick execution. ... which I released broken; on the off chance you have one of these,...
Read more >
Why Too Many Threads Hurts Performance, and What to do ...
Because the most efficient number of compute threads depends upon the particular hardware, programming in terms of threads can be a poor way...
Read more >
site:self.admincraft - Reddit post and comment search
Hello,. I am trying to set up a minecraft server with 27 plugins, and an average of 10 players. The server is running...
Read more >
Spottedleaf/Starlight Alternatives and Reviews (Aug 2021)
A Fabric mod designed to improve frame rates and reduce micro-stutter ... Hence, a higher number means a better Starlight alternative or higher...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found