Author Topic: [Guide] The freaking -server option & ram usage  (Read 4109 times)

Offline Trance

  • Everybody lies
  • Customer
  • Oel Mahum Witch Doctor
  • *
  • Posts: 555
  • Awards Customer crew on duty !
[Guide] The freaking -server option & ram usage
« on: December 26, 2013, 11:49:01 PM »
I enter on other's people dedicated daily and they're using the freaking normal JRE, damn.

The right bath settings for a live server, using Server JRE. As about what's below, it's up to your RAM, this is just an example.
Code: [Select]
java -server -Xms2g -Xmx4g -Xmn1g -XX:PermSize=256m -XX:SurvivorRatio=8 -Xnoclassgc -XX:+AggressiveOpts -cp ./libs/*; net.sf.l2j.gameserver.GameServer

More information about these settings:
Code: [Select]
-Xms : min heap size. Having 1.8GB (32bit) can be bad, because you don't let memory for anything else.
-Xmx : max heap size.
-Xmn : the size of the heap for the young generation. Good size is 33%.
-XX:PermSize : it's the third part of the memory. Here are stored classes, methods etc.
-XX:SurvivorRatio : "old generation" called tenured generation, ratio, in %.
-Xnoclassgc : disables class garbage collection. This option can cause unlimited native memory growth, leading to out-of-memory errors.
-XX:+AggressiveOpts : turn on point performance compiler optimizations.

Installation and downloading of Server JRE:
Code: [Select]
Do NOT install any other java version on your dedicated.
Server JRE doesn't need installation, just put it somewhere and set PATH environment variable system variable.

Properties on Computer -> Advanced system settings -> Enviroment Variables... and at 'System variables' search for Path, edit it and add further ";C:\jdk1.7.0_45\bin".

Extract the files after download http://www.oracle.com/technetwork/java/javase/downloads/server-jre7-downloads-1931105.html (using WinRAR or 7zip).

Extract 'server-jre-7u45-windows-x64.gz', after that you have to do the same thing with the next file, but you have to rename it in the first place, from "server-jre-7u45-windows-x64" to "server-jre-7u45-windows-x64.gz" and extract it.

Now you'll have an folder named 'jdk1.7.0_45', just copy it to C:\ and you're done.

p.s. Another option would be to use jdk, but w/e.
« Last Edit: December 27, 2013, 11:06:49 AM by Trance »

Offline Jackass

  • Inner Circle
  • Inferno Golem
  • *
  • Posts: 845
  • Argentina User.
Re: [Guide] The freaking -server option --ram usage
« Reply #1 on: December 27, 2013, 01:55:36 AM »
Yep that is a big problem for some ppl.

I learned it when i bought lameguard

Offline bildukas86

  • Elder Prairie Keltir
  • *
  • Posts: 35
  • Awards Customer crew on duty !
Re: [Guide] The freaking -server option & ram usage
« Reply #2 on: January 04, 2015, 07:29:54 PM »
I always used installed normal jdk on the linux vps, is it so wrong? I mean, do I need to use extracted version of the jdk and then add it to server launching sh?

Offline Trance

  • Everybody lies
  • Customer
  • Oel Mahum Witch Doctor
  • *
  • Posts: 555
  • Awards Customer crew on duty !
Re: [Guide] The freaking -server option & ram usage
« Reply #3 on: January 05, 2015, 04:19:35 AM »
I always used installed normal jdk on the linux vps, is it so wrong? I mean, do I need to use extracted version of the jdk and then add it to server launching sh?

JDK or Server JRE.

Offline bildukas86

  • Elder Prairie Keltir
  • *
  • Posts: 35
  • Awards Customer crew on duty !
Re: [Guide] The freaking -server option & ram usage
« Reply #4 on: January 05, 2015, 01:41:05 PM »
You got me confused totally.

So I need to use jdk extracted near to the lineage2 server folder, and then add the jdk libs into the launch sh?

OR

I can install jdk to the vps machine ant the server will simply work without any hardcoding the gameserver loop sh.

What's the difference?

Offline GuinaMaster

  • This is Revolution, Baby!
  • Giant Bee
  • *
  • Posts: 167
  • One hand washes the other hand.
  • Awards Customer crew on duty !
Re: [Guide] The freaking -server option & ram usage
« Reply #5 on: January 05, 2015, 03:42:23 PM »
omg... i not understand nothing...

 :ork1_2: :ork1_2: :ork1_2:

i use it:
Code: [Select]
java -Xmx12288m -cp ./libs/*; net.sf.l2j.gameserver.GameServer

on windows server 2003 64bits.

wrong?
read forum rules

Offline Rootware

  • Inner Circle
  • Orfen
  • *
  • Posts: 2.116
  • Awards Customer crew on duty ! Searched by gold diggers, loved by Mama Tryskell. Bring good advices or reports.
Re: [Guide] The freaking -server option & ram usage
« Reply #6 on: January 05, 2015, 04:02:09 PM »
Code: [Select]
-Xms2048m
-Xmx6024m

No more.
Code: [Select]
<html><head><body>Трискел:<br>
Трискел не говорит с дураками, которые не знают свою профессию!
</body></html>

Offline GuinaMaster

  • This is Revolution, Baby!
  • Giant Bee
  • *
  • Posts: 167
  • One hand washes the other hand.
  • Awards Customer crew on duty !
Re: [Guide] The freaking -server option & ram usage
« Reply #7 on: January 05, 2015, 04:07:27 PM »
Code: [Select]
REM -------------------------------------
REM Default parameters for a basic server.
REM java -Xmx12288m -cp ./libs/*; net.sf.l2j.gameserver.GameServer
REM java -Xmx512m -cp ./libs/*; net.sf.l2j.gameserver.GameServer Retail
REM
REM If you have a big server and lots of memory, you could experiment for example with
REM java -server -Xmx1536m -Xms1024m -Xmn512m -XX:PermSize=256m -XX:SurvivorRatio=8 -Xnoclassgc -XX:+AggressiveOpts
java -server -Xms2048m -Xmx6024m -Xmn1g -XX:PermSize=256m -XX:SurvivorRatio=8 -Xnoclassgc -XX:+AggressiveOpts -cp ./libs/*; net.sf.l2j.gameserver.GameServer
REM -------------------------------------

with it start without problem the gs...
thanks
read forum rules

Offline SweeTs

  • ╭∩╮(︶︿︶)╭∩╮
  • Fanatic Fan
  • Core
  • *
  • Posts: 3.586
  • You're never too old to learn something stupid.
  • Awards Do what you want 'cause a pirate is free, you are a pirate ! Searched by gold diggers, loved by Mama Tryskell. Bring good advices or reports. Crazy Banana.
Re: [Guide] The freaking -server option & ram usage
« Reply #8 on: January 05, 2015, 04:13:35 PM »
Ofc..

Code: [Select]
Xmx12288m

Just set 12G, there is no need to 'convert' it into m :D

Offline Rootware

  • Inner Circle
  • Orfen
  • *
  • Posts: 2.116
  • Awards Customer crew on duty ! Searched by gold diggers, loved by Mama Tryskell. Bring good advices or reports.
Re: [Guide] The freaking -server option & ram usage
« Reply #9 on: January 05, 2015, 04:20:42 PM »
More than 6G java will not use. True for L2J.
Code: [Select]
<html><head><body>Трискел:<br>
Трискел не говорит с дураками, которые не знают свою профессию!
</body></html>

Offline BlackForce

  • Kobold
  • *
  • Posts: 49
Re: [Guide] The freaking -server option & ram usage
« Reply #10 on: January 26, 2015, 02:10:56 AM »
Recomendation for dedicated server 16gb de ram, use geodata l2D ?

Offline roko91

  • Inner Circle
  • Minotaur
  • *
  • Posts: 431
  • Awards Searched by gold diggers, loved by Mama Tryskell.
Re: [Guide] The freaking -server option & ram usage
« Reply #11 on: January 26, 2015, 03:14:52 AM »
Recomendation for dedicated server 16gb de ram, use geodata l2D ?
It depends on how far you will get with the players count. But as Root said -Xmx6g should be enough. If you need more you can easily increase it later.

Offline Hasha

  • Inner Circle
  • Ant Queen
  • *
  • Posts: 1.820
  • Super Trooper
  • Awards Searched by gold diggers, loved by Mama Tryskell. If your ideas were electricity, you could probably power a city. Bring good advices or reports. H for Hasha
Re: [Guide] The freaking -server option & ram usage
« Reply #12 on: January 26, 2015, 07:00:15 AM »
Recomendation for dedicated server 16gb de ram, use geodata l2D ?
Rough calculation for minimum:

500MB server with no geodata
2GB server with full geodata

+

2MB * maximum amount of players
« Last Edit: January 26, 2015, 07:02:07 AM by Hasha »
Hasha, DreamLand core/datapack developer.

"Genius is an idiot, who does't know that problem cannot be solved and he solves it."
"Knowledge gives the feeling of beeing smart to dumb people and beeing dumb to smart people."
"Nobody remains virgin, live fucks everyone."
"Time wasted with a joy is not wasted time."
Dreams: "When they come true, you don't know what to do."

Offline BlackForce

  • Kobold
  • *
  • Posts: 49
Re: [Guide] The freaking -server option & ram usage
« Reply #13 on: January 27, 2015, 12:48:07 AM »
Thanks hasha and roko  =)