LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 02-29-2024, 03:43 PM   #1
ultimate_kidd
LQ Newbie
 
Registered: Feb 2024
Posts: 5

Rep: Reputation: 0
Question I am trying to make a Minecraft Java Edition server on Debian 12 with mods


I have been working on making a swap file because every time I use the terminal to use the following option:
java -Xmx2G -Xms1G -jar server.jar
to start the server, it crashes. I have tried multiple different options for how much ram I should allocate but every time it crashes.
When I use the following command
sudo mkswap /swapfile
To check if it's enabled or not, I get an error saying:
swapon: /swapfile: swapon failed: Device or resource busy
Does anybody know a fix to this?
I am only 14 so if you can sum up your text any easier to make it more understandable that would be very nice of you
 
Old 02-29-2024, 04:20 PM   #2
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,784

Rep: Reputation: 5937Reputation: 5937Reputation: 5937Reputation: 5937Reputation: 5937Reputation: 5937Reputation: 5937Reputation: 5937Reputation: 5937Reputation: 5937Reputation: 5937
How much physical memory is installed in the computer?
sudo swapon -s should show if swap is enabled as well as a non zero number from the output of the command free.

You probably need to specify more ram if you got it. Min is 2GB but with mods I think you need more. I don't think adding more swap is going to help.
 
Old 02-29-2024, 04:41 PM   #3
ultimate_kidd
LQ Newbie
 
Registered: Feb 2024
Posts: 5

Original Poster
Rep: Reputation: 0
This is the memory total:
4007992
this is how much is being used:
3439564
do you know how much ram that is?
thank you for your response
I will try the sudo swapon -s command
 
Old 02-29-2024, 05:01 PM   #4
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,784

Rep: Reputation: 5937Reputation: 5937Reputation: 5937Reputation: 5937Reputation: 5937Reputation: 5937Reputation: 5937Reputation: 5937Reputation: 5937Reputation: 5937Reputation: 5937
That is basically 4GB. Total used also includes buffers a cache so that does not look out of the ordinary.
What other min,max options have you tried? Have you tried Xms2G Xmx2G or Xms2G Xmx2.5G?
I'm thinking with mods you might not have enough memory.
 
Old 02-29-2024, 05:09 PM   #5
ultimate_kidd
LQ Newbie
 
Registered: Feb 2024
Posts: 5

Original Poster
Rep: Reputation: 0
I tried XMx 4G and XMs 2G and added 2G each time from there. I'll try what you said. I Only put 1 mod in the a folder for the server, its this mod
https://reforged.gg/
I got the one for 1.20.2 that's the only mod I put in though
 
Old 02-29-2024, 05:19 PM   #6
ultimate_kidd
LQ Newbie
 
Registered: Feb 2024
Posts: 5

Original Poster
Rep: Reputation: 0
Xmx 2G and XMx 2G worked! Thank you very much! I resolved the problem
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
LXer: Minecraft NFC -- How one man took Minecraft to the next level LXer Syndicated Linux News 0 02-21-2016 05:53 AM
[SOLVED] Launch Minecraft and Minecraft server as non-root user Hasek39 Linux - General 4 01-04-2016 03:06 AM
Minecraft world trickery (and even minecraft on ipad) lhartvik LinuxQuestions.org Member Success Stories 2 05-28-2015 01:32 AM
LXer: GOL MineCraft Weekly. Grab Issue 2 Today, Linux Minecraft server LXer Syndicated Linux News 0 08-04-2013 11:41 AM
Which edition (desktop edition or Server edition) best for Oracle RAC on vm thmsvng Linux - Virtualization and Cloud 2 11-26-2009 04:13 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 02:38 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration