How to allocate memory for Java. Allocate more memory for Java. Boosting Windows Virtual Memory

In this post I will tell you how to increase the maximum amount of allocated random access memory under Minecraft. This is necessary primarily in order to remove lags in Minecraft and to make the game as a whole work better.

What is it for?

On Minecraft, by default, only 1 Gigabyte of RAM is allocated, and I think you will agree with me that this is very little. Considering the very rapid progress, we can safely assume that more than 50% of all computers have more than 2 gigabytes of RAM or more, and if your computer is one, then you can increase the FPS in the game and thereby ensure a more enjoyable game.

What is RAM (Random Access Memory)?

RAM (Random Access Memory)- This is an integral part of the computer, which is a temporary storage of data and operations that the processor needs to perform operations. In a word, the more RAM you have, the more data it can hold and, as a result, the processor will process it faster.

Now let's move on to the practical part of this article.

First of all, we need to make sure that our Java drivers are installed correctly. The fact is that everything may work well for you, but nevertheless, you may have installed the drivers not in accordance with your Windows bit level. As you know, Windows comes in 32-bit and 64-bit versions, and you need to download your own drivers for each system.

You can find out what system is installed on your PC by right-clicking on “My Computer” (RMB) and selecting the last item “Properties”. You will see a window like the one shown in the picture below and in the line highlighted in red the type of your system is written.

Depending on the bitness of your system, download the drivers you need from the link below:

P.S. Before installing new drivers, be sure to remove the old ones!

After installing the new drivers, we go to the control panel and find the icon there:

Click on it 2 times and go to the Java settings menu. Next we go to the Java section and click the button: " View".

In the picture shown above, an empty field is highlighted with a red line; in it we will have to enter parameters that will subsequently allocate to our Minecraft the amount of memory that you need.

In order to allocate more memory, we need to enter the following command into this empty field (the numbers in the command are different for everyone, how to set your parameters is written below):

-Xms2048m -Xmx4096m

In my example, the command sets the range of allocated memory from 2 gigabytes to 4 gigabytes.

In order to decide what parameters to set, you need to know that you don’t need to overdo it. It is better to use not all the memory and leave a little for the needs of the computer.

For example, you have 4 gigabytes of RAM on your computer, which means in your case you should set the following parameters: -Xms1024m -Xmx3072m

In addition, you can use the parameter: -Xincgc, which frees unused objects from memory, thereby the work will be even better, especially on weak computers. Full command example:

-Xincgc -Xmx2048M

For 32-bit Windows is better just specify: -Xincgc -Xmx768M, there is no point in setting more, since there will be no benefit from this.

After you enter the command you need, click OK, and then Apply.

Now we go to the Minecraft launcher and click Edit Profile and find the last point there JVM Arguments, where we enter the maximum amount of memory that we specified in the previous settings. I had these: -Xms2048m -Xmx4096m, accordingly you need to insert into the field: -Xmx4096m

Here's what I got:

When I first became acquainted with this operation, I did everything correctly, but nothing worked. Later I solved this problem and the solution was simple.

I highlighted in red the root of my problems. This field contains the path to Java. We need to copy it.

Paste the copied path into the field that I have highlighted in red.

The fact is that when changing drivers, the paths of the root folders changed and Minecraft could not find the files it needed. This is such a simple, but at the same time necessary solution.

ATTENTION! Use only when absolutely necessary. There is no need to suffer through this hassle; the author simply had nothing better to do.

Greetings, wanderer.
If you have thought even a little about how to increase the speed of your server or client, you have come to the topic you need.

So, let's get started.
I have collected many arguments with descriptions that allow the server as well as the client to work more optimized and faster.

ATTENTION! In order to achieve maximum performance, it is better to select specific arguments rather than enter everything at once.
On different versions of Java and on different hardware, the arguments behave differently. So it’s better to double-check every time after setting the argument whether the performance has improved or not.

Example start line:

Java -argument1 -argument2 -argumentN server.jar

My server startup line:

Java -Xmx5G -Xmn192M -XX:+UseConcMarkSweepGC -jar server.jar

My client's arguments:
Dedicating Java to specific kernels (Linux only)

Before the server start command, add this command:

Taskset -c [kernel] [run command]

[cores] = 0,1,2,3 - must be specified in this format.
We express our gratitude


List of arguments:

Basic flags

  • -Xincgc- activates the garbage collector, which will periodically unload unused RAM. The collector type is selected depending on the Java version.
  • -server- activates the server version of Java, which by default supports experimental flags, and also speeds up the compilation of classes, which gives a performance boost, but increases startup time (64-bit systems only)

Click to expand...

Memory allocation
  • -Xmx5G- the amount of maximum allocated memory for the server
  • -Xms512M- the amount of minimum allocated memory for the server
  • -Xmn128M- the amount of memory allocated for short-lived objects (which were not unloaded by the garbage collector)
  • -XX:MaxPermSize=128M- amount of memory for PermGen Space (does not work on Java 8)
  • -XX:SharedReadOnlySize=30M- amount of memory for read-only space in PermGen

Click to expand...

Garbage collectors
This is a sore subject, I advise you to experiment in order to achieve at least something worthwhile, and not, on the contrary, worsen performance.

MINI TIP: For single-core processors, use any garbage collector, but do not specify the number of threads for it. On this moment the best garbage collector for cube is ConcMarkSweepGC. The higher the number SurvivorRatio- the better, the less old objects will clutter up the RAM. The more TargetSurvivorRatio- the more old objects will be cleared (it is advisable not to set more than 90).
Use MaxGCPauseMillis best with G1GC or a specifically specified garbage collector. AutoGCSelectPauseMillis- with a collector that the system itself will select. G1HeapRegionSize It’s better not to install, java itself will select the optimal value, use only if you know what you are doing.

  • -XX:+UseSerialGC- includes a garbage collector that runs in 1 thread
  • -XX:+UseConcMarkSweepGC- Enables a garbage collector that leverages the power of multiple processors.
  • -XX:ConcGCThreads=2- number of processes for the garbage collector.
  • -XX:+UseG1GC- activates a new garbage collector, divides all memory into certain areas, and thanks to the use of several cores, collects unused memory from all areas.
  • -XX:G1HeapRegionSize=32- the amount of memory allocated for each section.
  • -XX:AutoGCSelectPauseMillis=2500 - the amount of time in milliseconds between calls to the automatically selected garbage collector.
  • -XX:MaxGCPauseMillis=1000 - the length of time in milliseconds between calls to a particular garbage collector. For G1GC it acts as the maximum set gap.
  • -XX:SurvivorRatio=8- the amount of radius for the existence of surviving objects (the smaller the number, the larger the space). More space allows newly generated objects to live longer before being cleared out.
  • -XX:TargetSurvivorRatio=90- the amount of space in percentage for surviving objects, which will allow more unused objects to be cleaned up during garbage collection.

Click to expand...

Experimental arguments
  • -XX:+AggressiveOpts- activation of experimental Java machine options.
    (-XX:AutoBoxCacheMax=20000 -XX:BiasedLockingStartupDelay=500 -XX:+EliminateAutoBox -XX:+OptimizeFill -XX:+OptimizeStringConcat)
  • -XX:+UseBiasedLocking- acceleration of object synchronization on multi-core processors.
  • -XX:+UseFastAccessorMethods- use of optimized versions of method calls.
  • -XX:+UseFastEmptyMethods- exclusion of empty methods from compilation.
  • -XX:+UseCompressedOops- reducing the size of the index, headings, as well as shifts inside the created objects. Depending on the code, it will save 20-60% of RAM.
  • -XX:+OptimizeFill - replacing cycles of working with arrays with machine code, which speeds up work
  • -XX:+OptimizeStringConcat- optimization of concatenation of String type objects. Instead of calling one operation 20 times for 20 characters, it calls once for 400 characters
  • -XX:+UseStringCache- enables caching of String type objects. Where and how it is cached is not clear.
  • -XX:-UseGCOverheadLimit- ignores lack of memory for garbage collection, partially eliminates Out Of Memory Error
  • -XX:+CMSIncrementalPacing- automatic regulation of CMS processes in Incremental mode.
  • -XX:+CMSCleanOnEnter- cleaning the CMS when starting the Java machine.
  • -XX:+UseInterpreter- enable interpreter for uncompiled methods.
  • -XX:UseSSE=4- use of processor SSE instructions. (0 - disable, 1/2/3/4 - use SSE/SSE2/SSE3/SSE4)
  • -XX:MaxTenuringThreshold=15- the number of copies of surviving objects between different places.
  • -XX:+RewriteFrequentPairs- rewriting recently used bytecode pairs into one.
  • -XX:+UseInlineCaches- use of out-of-order caching for virtual calls.
  • -XX:+UseThreadPriorities- use of priority for the Java machine process.
  • -XX:ThreadPriorityPolicy=42- setting process priority to increase allocated resources.


Description: 18 ways to run MineCraft on your computer without problems. Some of the most important tips are at the bottom of the list.

1. Adjust allocated RAM memory (simple and very effective thing)
On a 32-bit system (on a 64-bit, you should go to the 32-bit Control Panel), go to Control Panel and open "System" - "Java". What you are looking for is the amount of RAM. (Usually MB or GB) Write down the amount you have. Then open a Java window and go to the Java tab. In the Java Runtime Environment Settings section, click the Search button. In this window, under the "user" tab, go to Environment Variables execution and put into the amount of RAM that you want to use in MineCraft. Depending on how much RAM you have, you should install in the following order:
RAM | put variables in the runtime environment
256-512 | Changing this will not help only 512
513MB-1024MB | Xmx512m-or-Xmx700m
1025MB-2048+ | -Xmx1024m
Once you do this you should see a significant increase in speed in MineCraft

2. Set "javaw.exe" to high priority.
Hold "Control" and "Shift" on your keyboard at the same time and press "Escape". This will open the task manager. Now open MineCraft. This will initialize Java. In the task manager, go to the "Processes" section. In this tab, find the "javaw.exe" process. Once you've found it, right-click on it and under "Set Priority" select "extra" or "High".

3. Download and install Optifine (More complex, but very effective)
Go to the Optifine modeling page and download the Optifine installation. Then set the parameters of your desire.

4. Download the latest drivers. (Quite simple, very effective)
Go to the brand website graphic cards(e.g. NVIDIA, ATI, Intel).

5. Adjust Graphics/Video Card Settings (more complex and very effective)
WITH Nvidia card graphics, go to Control Panel (Start menu). Under 3D Settings, go to "Manage 3D Settings". Here you can select "*.EXE" files and settings for them. If you are using the downloadable version of Minecraft, then select Minecraft.exe and adjust the settings recommended for speed.

6. Turn on the sound if it is turned off in MineCraft
According to MineCraft settings (not computer settings), turn on sounds and music. This may seem strange, but sound is a completely different matter for MineCraft to run, and in my experience, it can have a big impact.

7. Get a new video card (costs $IVE, but very effective)
Just get a new video card for your computer. That's how simple it is. :P

8. Set your computer's performance to default (simple, but not very effective)
Go to Control Panel and select "System". Go to the "Advanced" tab and in the "Performance" section, click the "Settings" button. On "Visuals", select "Custom" and de-select things you can live without. Most of them can be turned off and you won't notice a difference. Then go to the "Advanced" tab and in the "Virtual Memory" section, click the "Change" button. Select a drive that has at least 2 MB free space, and then under "Swap file size for selected drive", set the minimum to 1024 and the maximum to 2048. You can increase the value if you want. Doing this will also help with your first MineCraft solutions to run faster because it will make your computer More "RAM", however, the disk space used as RAM will not be as fast as normal RAM.

9. Clean up your computer. (Takes very little time, but effective)
Open the Start menu and go to All Programs. In the "Accessories" section and in the "Utilities" section, select "DiskCleanup". This will scan your computer for unnecessary files. (If you haven't done this for a while it will take a long time, so be paitent.) Once the scan is done, follow the link " Extra options" tab and under "System Restore" select "Clean up". This may also take a while. Then go back to "Disk Cleanup" and select all the checkboxes except the "Compress old files" option. Then click "OK". This may also take some time. Once this is done, go back to the Start menu, go to All Programs, then Accessories, then System Tools and click on the "Disk Defragmenter" button. Select the drive you have Minecraft on and click on the "Disk Defragmenter" button. Defragmentation." This will most likely take a long, long, long time, but it will be worth it in the end.

10. Close any unnecessary program.
Just close everything unnecessary programs. =0

11. Close all unnecessary tray icons (Derp is easy and effective if you have a slow computer)
Right-click on the tray icon and click "Exit" if possible. Not all tray icons will be closed by doing this.

12. Make sure your computer has been running for a while
Just wait about 5-10 minutes before you start working with MineCraft after starting your computer.

13. Remove unnecessary mods (simple and very effective)
Removing unnecessary mods from MineCraft helps instantly.

14. Do not run MineCraft in full screen mode.
If you run MineCraft on full screen, your computer/video card should render twice as many blocks as five times, or just render them more High Quality, thereby slowing down MineCraft.

15. Download the latest version of Java.
Go to the JAVA website and download the latest version of Java.

16. If you have a 64-bit system, use it! (Very effective!)
Download 64-bit Java for your computer, it will help A LOT!

17. Buy new computer. (Effective immediately)
If your computer cannot run Minecraft, after what is written above, then you just need a new computer.

18. Put the cat on your computer (most effective way)
Put the cat on your computer! MineCraft increasing speed and even going into outer space!!! Download

I think Minecraft is a little slow for everyone and often these problems are caused by lack of Java memory, in this article I will tell you how to increase more memory for java.

Step 1.

Open Control Panel.

Step 2.

Type "Java" in the "Search Control Panel" field.

Step 3.

Click on the Java icon that will pop up.

Step 4.

Go to the Java tab.

Step 5.

Click View...

Step 6.

Make sure there is only one line, more lines can cause problems.
If you have multiple lines, remove all versions of Java from the system and...
...download Java JDK 7 from the following link.

Make sure that you have a 64-bit OS, then download Java JDK 7.

Step 7

Change execution options.
I have these:
-Xincgc-Xmx2048M
Change it depending on how much RAM you have.
For 32-bit operating systems, the 768M is recommended.
If you have a 64-bit OS, and you have above 768M and everything slows down, set it in the settings
1G
1536M
2G
As I said, it depends on how much RAM the system has.

Step 8

Click OK.

Step 9

(Optional)
No system reboot required.

Step 10

Voila! Launch Minecraft and be glad that you have such an assistant as our site!!!

You will have a new one Text Document in the same place where the minecraft.exe file is located. Name the file "Minecraft New Launcher". If you are having RAM problems while playing Minecraft, then you should allocate more memory to the Minecraft game. If you are using new version Minecraft, then you just need to allocate more RAM in the bootloader. If you are using old version, then you need to create a batch file that will run the game with a large amount of allocated memory. If you have a server, then you need to add additional RAM, this way you will increase the performance of the build.

If you are using Minecraft 1.6 or newer.


Click on Windows+Pause Break. Check quantity installed memory. This way you will know the amount of memory that can be allocated to the Minecraft game.​


3.Launch Minecraft loader.
In 1.6.X and newer versions you can allocate RAM directly in the bootloader



4.Select your profile.
Use the menu to select your profile. Click on the Edit profile button.



5.Enable JVM Arguments.
In the "Java Settings (Advanced)" section, check the "JVM Arguments" box. You will then be able to enter commands to modify the Minecraft program.



6.Assign additional memory.
The standard value of RAM in Minecraft is 1 GB of memory. This value can be increased by writing -Xmx#G. Replace # with the number of GB of memory for the game. For example, to allocate 3 GB of RAM, enter -Xmx3G.
  • Don't forget to leave memory for your system. For example, if you have 8 GB of memory, then do not allocate more than 7 GB for the game.



7.Save your profile.
Click on the Save Profile button to save the settings.



8.Launch Minecraft.
Launch the game. The game will now run with the new amount of memory.



9.Check your settings.
During the game, press the F4 button, the console will open. Look at the line "Allocated memory:", there you will see how much RAM is allocated to the Minecraft game


If you are using Minecraft 1.5 and older


1.Check the amount of available RAM.

Click on Windows+Pause Break. Check the amount of installed memory. This way you will know the amount of memory that can be allocated to the Minecraft game.

  • If you don't have enough RAM available, then you should buy additional RAM. This is the easiest way to upgrade your computer.



2.Install the latest version of Java SE.
This way you can allocate more memory for Minecraft games, which runs in Java. Go to the official Java website to download and install latest version Java.
  • Make sure you download the correct version of Java (32-bit or 64-bit) for your operating system. To find out what Windows version installed on your computer, press Windows+Pause Break.



3.Open the folder with the Minecraft game.
Find the Minecraft.exe file



4.Right-click and select New – Text Document.
You will have a new text document in the same place where the minecraft.exe file is located. Name the file "Minecraft New Launcher".



5.Enter the code to allocate additional memory.
Enter the following code into a text document:
  • Change #### to the megabyte value you want to allocate. To allocate 2 GB of RAM, enter 2048. To allocate 3 GB of RAM, enter 3072. To allocate 4 GB, enter 4096. For 5 GB, enter 5120.



Top