LagFixer

This project is abandoned.

Whether this project is out of date or its author marked it as abandoned, this project is no longer maintained.

If you wish to take this project over, please report it and state your intentions.

Lightweight and efficient at the same time!

Why LagFixer?

Well, Java creates different Objects all the time. This Objects have a specific sense but after they did their job, they are not needed anymore. Java normally sorts this "not needed" Objects out and removes them from the memory.

Thing is: Java does not automatically remove ALL not needed Objects. Some - although they became useless - stay in the memory of a server. They are most likely removed after some time, but some useless Objects always stay. The amount of useless Objects rises from time to time.

What LagFixer does, is calling the Java Method "System.gc();" after a configurable amount of time. This method makes Java search for all remaining useless Objects in order to delete them. A really effective method especially for Bukkit Servers: Bukkit Servers often run many different Plugins, and all of them create different Objects which lead to a bad performance. That's the reason, why many Bukkit Servers have to restart after some Time: Because else they would crash due to a high amount of useless Objects in memory.

Before I tried the Garbage Collector out, I didn't really believe it would work, because I thought Bukkit itself would handle things like that. I was wrong...

Just try it out yourself! Before and After LagFixer is executed, the current memory is displayed in the Console/Server.log

Features

  • Removes unused Objects from the memory
  • Executed every x seconds (Configurable amount of time)
  • Current memory before and after execution is shown

Commands

  • /memory - Shows current Memory

Permissons

  • LagFixer.Memory - Permission for the /memory command

Disclaimer

Link to Discussion against gc()

Calling the garbage collector should not be needed, but I've seen so many poorly coded plugins, where I think it actually helps. I personally always had doubts about the garbage collector and possible disadvantages but all my tests worked fine (On servers with 200+ players) and it really increased the performance. Java has an automatic clever garbage collector which should remove all unused objects as soon as a specific amount of objects is reached, however I've seen many servers crashing due to memory issues. LagFixer solved this crashes. Just test this out yourself, it doesn't hurt!

You must login to post a comment. Don't have an account? Register to get one!

  • Avatar of twipsta twipsta Mar 20, 2014 at 19:52 UTC - 0 likes

    In windows it reports the correct amount of ram, and outputs correctly with both sheduled gc and running the /memory command. But then I uploaded it to a hosted server running linux and it reports incorrectly.

    Windows (1gb ram):
    [INFO]: Current Memory (Free/Max | Used (%)): 857MB/955MB | 98MB (10%)

    Host (6gb ram, Essentials reports 5,333mb):
    [INFO] Current Memory (Free/Max | Used (%)): -1915MB/1297MB | 3212MB (247%)

    Using 247% of ram capacity is quite an oddity :)

  • Avatar of Blackixx Blackixx Mar 10, 2014 at 16:55 UTC - 0 likes

    @ch0xy: Go

    nope :P It will work fine :)

    Inactive due to time issues...

    ManaWar (Click Me!)

  • Avatar of ch0xy ch0xy Mar 10, 2014 at 08:09 UTC - 0 likes

    Do you think this would bring any issues on a 1.6.4 server?

  • Avatar of Blackixx Blackixx Jan 13, 2014 at 19:54 UTC - 0 likes
  • Avatar of PrimoHighDefinition PrimoHighDefinition Jan 13, 2014 at 19:52 UTC - 0 likes

    Is this working with spigot?

  • Avatar of Blackixx Blackixx Jan 12, 2014 at 18:08 UTC - 0 likes

    @CommodoreAlpha: Go

    " I read that relying on calling the garbage collector is an indicator of a fundamentally broken system. In this scenario, what exactly is broken?"

    It can be used as an indicator of a fundamentally broken system but LagFixer rather is used to prevent the amount of unused objects from being high, to solve crashes and to prevent the lag caused by poorly coded plugins (This of course won't fix all lags caused by poorly coded plugins)

    "If, say, you're running a minimal amount of well-built plugins that are optimised by professional developers, and you're holding 200+ players all the time, would you ever need to manually call the garbage collector?"

    If everything is running fine without LagFixer: No.

    Otherwise I suggest testing it out. It might be a huge improvement for your server or it might do almost nothing.

  • Avatar of CommodoreAlpha CommodoreAlpha Jan 12, 2014 at 17:11 UTC - 0 likes

    So wait, I'm a bit confused. I read that relying on calling the garbage collector is an indicator of a fundamentally broken system. In this scenario, what exactly is broken?

    If, say, you're running a minimal amount of well-built plugins that are optimised by professional developers, and you're holding 200+ players all the time, would you ever need to manually call the garbage collector?

    If not, then it's pretty clear the "bottleneck" in efficient memory usage is plugins. But if you still need to do a manual call under this circumstance, then wouldn't it be inferred that Bukkit or Minecraft is inherently "broken"? (As I've said, assume there are a minimal amount of plugins that are highly optimised.)

    In other news, that article was a very good read. Thanks for pointing me in that direction. :)

    Server Information: "antarcticspecops.webs.com"

    Antarctic Special Operations, home of the buggiest (modded) server ever! With the most incompetent admin (me) also! Currently unplayable on survival due to construction accidents involving but not limited to a rebar in the face. I'll consider opening for Beta testing as soon as I overcome my incompetence. <3

  • Avatar of Blackixx Blackixx Jan 12, 2014 at 08:42 UTC - 0 likes

    @CommodoreAlpha: Go

    Just added this disclaimer: http://snapcr.net/c/36fe.png

  • Avatar of EDawg878 EDawg878 Jan 12, 2014 at 00:49 UTC - 0 likes

    @CommodoreAlpha: Go

    Because this plugin is redundant since Java has automatic garbage collection.

    See: http://stackoverflow.com/questions/2414105/why-is-it-a-bad-practice-to-call-system-gc

    Last edited Jan 12, 2014 by EDawg878
  • Avatar of CommodoreAlpha CommodoreAlpha Jan 11, 2014 at 23:00 UTC - 0 likes

    If it's this useful, then why hasn't been implemented before, or why hasn't a plugin like this one come out a long time ago? (I'm not skeptical of your plugin, but I am curious.)

Facts

Date created
Jan 08, 2014
Category
Last update
Jan 09, 2014
Development stage
Abandoned
License
GNU General Public License version 3 (GPLv3)
Downloads
734
Recent file
  • R: v1.0.0 for CB 1.7.2-R0.2 Jan 09, 2014

Authors