Those little things that irk you about Minecraft

  • Please make sure you are posting in the correct place. Server ads go here and modpack bugs go here
  • The FTB Forum is now read-only, and is here as an archive. To participate in our community discussions, please join our Discord! https://ftb.team/discord

GreenZombie

New Member
Jul 29, 2019
2,402
-1
0
Press F3 and MC literally tells you how much memory it is using. Play for a bit and then adjust your -XMX to be a bit larger than the used memory: Double it if you are lazy, or make it +20% and monitor the peak usage for a while.
 
  • Like
Reactions: Type1Ninja

malicious_bloke

Over-Achiever
Jul 28, 2013
2,961
2,705
298
I have found that java will steadily start using more and more RAM as a minecraft session continues.

I've got 4 gigglebits assigned to FtB and it starts off at about 40% usage, but if I play for 6-7 hours it steadly creeps up towards 100%

Relogging fixes it though.
 
  • Like
Reactions: Padfoote

Someone Else 37

Forum Addict
Feb 10, 2013
1,876
1,440
168
I have found that java will steadily start using more and more RAM as a minecraft session continues.

I've got 4 gigglebits assigned to FtB and it starts off at about 40% usage, but if I play for 6-7 hours it steadly creeps up towards 100%

Relogging fixes it though.
Before it hits 100%, though, the Garbage Collector *should* kick in and clear out most of the unused data in memory, thus freeing up RAM for other purposes. This, incidentally, is exactly why assigning more RAM to Java than you really need causes problems- the GC causes a lag spike when it kicks in, and the more unused junk there is in memory when it kicks in, the worse that lag spike will be.
 

OreCruncher

Well-Known Member
Mod Developer
May 22, 2013
312
217
73
My Chair
Before it hits 100%, though, the Garbage Collector *should* kick in and clear out most of the unused data in memory, thus freeing up RAM for other purposes. This, incidentally, is exactly why assigning more RAM to Java than you really need causes problems- the GC causes a lag spike when it kicks in, and the more unused junk there is in memory when it kicks in, the worse that lag spike will be.

And this is where mods get "Retarded" sometimes. The constant reallocation of objects just creates more work for the GC. Granted there is some intelligence built into the Java heap manager but it isn't perfect.
 

Padfoote

Brick Thrower
Forum Moderator
Dec 11, 2013
5,140
5,898
563
Before it hits 100%, though, the Garbage Collector *should* kick in and clear out most of the unused data in memory, thus freeing up RAM for other purposes. This, incidentally, is exactly why assigning more RAM to Java than you really need causes problems- the GC causes a lag spike when it kicks in, and the more unused junk there is in memory when it kicks in, the worse that lag spike will be.

Should, but not when there's a memory leak, which is what I've run into with dimension travel.
 

keybounce

New Member
Jul 29, 2019
1,925
0
0
There's at least two things going on here.

First, there are memory leaks. I'm not sure of the cause. Yes, dimension changes cause it more than other things.

Java and the GC: My first advice is to switch to CMS. I get lag spikes using the default collector even without massive memory.

Here's my current startup string:

-Dfastcraft.debug.fwel -Xms1080m -Xmx3300m -XX:MaxPermSize=250m -XX:+UseConcMarkSweepGC -XX:+ExplicitGCInvokesConcurrentAndUnloadsClasses -XX:MaxHeapFreeRatio=25 -XX:MinHeapFreeRatio=22 -XX:CMSInitiatingOccupancyFraction=80 -XX:-CMSPrecleaningEnabled -XX:NewSize=800m -XX:MaxNewSize=800m -XX:SurvivorRatio=3 -XX:TargetSurvivorRatio=80 -XX:SoftRefLRUPolicyMSPerMB=1 -XX:+PrintTenuringDistribution -XX:MaxTenuringThreshold=4 -XX:+PrintCommandLineFlags -XX:+PrintHeapAtGC -XX:+PrintGCDetails -Xloggc:GC.log -XX:+PrintGCDateStamps

Things to note:
1. The gigantic size of new (Eden and survivor). This makes a huge difference in preventing unwanted promotion to tenured; that makes a huge difference in preventing major collections.

And yes, modded minecraft can use that much.

2. Survivor Ratio can be tuned; client's memory usage is not the same as server's, and single player wants slightly different (have not tested LAN mode). Smaller makes eden bigger, larger makes survivor bigger.

3. Starting memory and max memory are not the same. I don't want Java to just grab the worst-case memory all the time (I do run other programs), but I also want java to use what it needs.

Normal java behavior is to do minor cleanups frequently (as eden/survivor fill), which is fast, and does return memory -- but it also sends stuff to tenured. The more frequent the minor cleanups, the more frequent stuff goes to tenured. Tenured doesn't clean up until all the memory currently in use is full -- yet another reason to say "only use what you need", rather than "use the worst-case all the time".
 
  • Like
Reactions: GreenZombie

rhn

Too Much Free Time
Nov 11, 2013
5,706
4,420
333
My 16 gigs of ram+2 gig dedicated video card cant run jack. I give it a full 12 gigs that it can use but it says "nope" and crashes every 30 seconds.
Well that is great(actually dedicating 12GB just shows you don't understand how RAM works. More is not better. If you have enough, then more will not help). But it is not RAM nor the video card that is the limiting performance factor of Minecraft(You also cannot measure a graphic card by its VRAM....). It is the CPU that processes nearly everything going on in the huge simulation that is modded Minecraft. And if you are moving around(loading new chunks with new things in them) then lots of data needs to be loaded from the Harddrive to the RAM. Here bandwidth is key and it is therefore a good idea to have a SSD.

So in essence: Having lots of RAM is pointless. Minecraft cannot use more than the total file size of things that needs to be loaded into RAM. And that is about 4GB max for large modpacks and a x64 texture pack(more if you use larger texture packs). Having a beafy graphic card is also rather inconsequential, since there is no advanced graphical processes in Minecraft to be calculated by the graphics card. It is all down to the CPU which needs to calculate everything going on in the world around you. And a lesser degree the bandwidth of your harddrive which is important when you travel around.
 

keybounce

New Member
Jul 29, 2019
1,925
0
0
. Minecraft cannot use more than the total file size of things that needs to be loaded into RAM. And that is about 4GB max for large modpacks and a x64 texture pack

Just to clarify, I have seen mods that would generate a gig of data in the worst case, just to track what their blocks are doing...

(It was a forge finite liquid, with custom spread mechanics. Imagine a gas, being generated in the air, with both a "heavy/dense" form that floated down, and a "light" form that floated up and out of the world.)
 
  • Like
Reactions: Type1Ninja

GreenZombie

New Member
Jul 29, 2019
2,402
-1
0
Just to clarify, I have seen mods that would generate a gig of data in the worst case, just to track what their blocks are doing...

(It was a forge finite liquid, with custom spread mechanics. Imagine a gas, being generated in the air, with both a "heavy/dense" form that floated down, and a "light" form that floated up and out of the world.)

What kind of mod would have such an arcane mechanic!? It leaves me completely befluxed.
 

Azzanine

New Member
Jul 29, 2019
2,706
-11
0
So essentialy Modded MC needs higher frequency Cpus (more weaker cores will not do) and smooth access to your HD I.e high bandwidth, so other then useing a SSD (the optimal choice) a magnetic disk HDs with a high read write speed and wide bandwidth should suffice?
So ram is inconsequential aside from having enough?

Sent from my GT-I9100 using Tapatalk
 
  • Like
Reactions: Type1Ninja

Type1Ninja

New Member
Jul 29, 2019
1,393
-7
0
Can we please get an abridged version of the above conversation stuck in the front of the tech support sub-forum?
I see about 1-2 performance related threads each week; the people who'd really get helped by this will probably never see it buried in this thread.​
Granted, they probably won't see it anyway; but then they can't blame us for not trying. :p
Title it "How to make Minecraft Fast".

Sent from my GT-I9100 using Tapatalk
Faster. :p
Subtitle: "Also it may not work depending on how good your computer is"
There should be a lengthy explanation of what exactly makes a good Modded MC comp (spoilered up of course), and a bolded section at the top explaining that you can't expect your computer to run MMC (modded minecraft) just because it runs Battlefield 4 or whatever.
 
  • Like
Reactions: JunpakuKarasu

rhn

Too Much Free Time
Nov 11, 2013
5,706
4,420
333
Can we please get an abridged version of the above conversation stuck in the front of the tech support sub-forum?
I see about 1-2 performance related threads each week; the people who'd really get helped by this will probably never see it buried in this thread.​
On principle it is a good idea. But it is obvious that the vast majority blatantly ignores stickied posts:
VAdYWxC.png

ZNQarSh.png
 
  • Like
Reactions: RedBoss and ljfa

rhn

Too Much Free Time
Nov 11, 2013
5,706
4,420
333
Probably because they don't know those stickies exist.
Probably, but that baffles me personally. It is listed in every major subforum. Pretty hard to miss unless you are deliberately trying to.
The first thing I do when joining a new forum is to:
  1. Orient myself about the structure of its subforums. So that I know what goes where.
  2. Look up the rules/guidelines/whatever. 9/10 times this is a sticky on top of the subforums. And usually there are loads of other important things I need to know before posting too.
  3. Search to make sure that what I want to post about haven't been answered before. Usually google I have already googled my problem, but I generally try the in-forum search engine too.
  4. Only then do I post on a new forum.