How to know what is taking up memory?

Discussion in 'Hosting Advice' started by RainOfPain125, Feb 10, 2018.

  1. Currently MC is using 1,300MB's of Memory and an in-game plugin I got claled "React" reports only 376MB's are being used

    Clearly something is wrong here. What's using up all the extra memory? Is there a plugin I could get or thing I can do to know what things in particular are using it?
     
  2. TheJavaHacker

    Supporter

    Are you sure the RAM you're seeing being used is being displayed on the client, or when you're running a /lag command with essentials?
     
  3. Not sure what you mean, but I did /lag in console -

    [12:34:22 INFO]: Maximum memory: 1,820 MB.
    [12:34:22 INFO]: Allocated memory: 832 MB.
    [12:34:22 INFO]: Free memory: 353 MB.

    Task Manager reports 1230MB's of use
     
  4. List your plugins here.
    Run a timings report.
    Checkout TopLite and LagManager to get reports on the intensity of plugins.
     
  5. https://timings.aikar.co/?id=745f8e3d81d745bd88a56b3e4e9b05dd

    Plugins (72): ActionAnnouncer, AdvancedBan, AreaShop, ArrowTrails, Auctions, Autorank, AutoSaveWorld, BlowableObsidians, BuycraftX, CFD, Chairs, ChatFeelings, ChatItem, ChestRestock, Citizens, ColoredAnvils, CombatLogX, CompatNoCheatPlus, CoreProtect, CrazyCrates, CrazyEnvoy, DailyBonus, DeluxeJoin, DiscordSRV, EpicRename, Essentials, EssentialsChat, eZProtector, FactionChat, Factions, FactionsFly, HolographicDisplays, HolographicScoreboard, InfoBook, InventoryFull, LimitCrafting, LuckPerms, MassiveBooks, MassiveCore, mcMMO, mcMMOAction, MessageAnnouncer, MobArena, Multiverse-Core, NametagEdit, NoCheatPlus, NoPlugins, OldCombatMechanics, Orebfuscator4, PerWorldInventory, PlayerHeads, PluginLibrary, ProtocolLib, React, ServerListPlus, ShopGUIPlus, ShulkerBlock, SilkSpawners, SilkSpawnersShopAddon, SimpleBackup, SuperbVote, SuperTrails, SuperVanish, Tablist, TitleManager, Trading, Vault, Votifier, Wild, WorldBorder, WorldEdit, WorldGuard
     
  6. Get rid of AutoSaveWorld to start with.
     
    • Creative Creative x 1
  7. And replace it with
     
  8. I would get rid of React. Why do you think you need it?
     
  9. Nothing, worlds are autosaved by default.
     
  10. Water / TNT suppression in case some idiot decides to spam it a bunch? That was about it
     
  11. TheJavaHacker

    Supporter

    Hold up, hold up - Are you running this server on your PC?
     
    • Agree Agree x 1
  12. Of course. Renting is a terrible concept
     
  13. TheJavaHacker

    Supporter

    1. Renting isn't a concept. By definition a concept is something that does not exist, or at least not yet.
    2. Renting is a good idea - It means you aren't exposing your home network to attackers
    3. It's also a good idea because home hosting can make your bills sky-rocket, which I'm 100% certain your family wouldn't want.
    4. It's even more of a good idea because then it's not eating valuable computing power for a block game server.
     
    • Agree Agree x 1
  14. I'm here for memory help, not a lecture. I already weighed the pro's and con's of renting and home hosting years ago and it's fairly obvious which one people should choose if they have the time and dedication

    1. Renting is a bad idea
    2. Cloudflare works, as well as other forms of simple free protection
    3. My internet uses a flat rate pricing. I've never heard of a billing plan where you pay for more data besides on mobile phones
    4. It isn't that hard to home host. Keeping this in mind, I built my computer with hosting in mind. It has a beefier CPU and twice as much RAM to compensate for it
    5. Some renters do not let you keep the data of the server. Once you stop paying, it's all gone for sure
    6. Renters need to make a profit. You don't. If you build a machine it's a one-time payment that will "pay for itself" compared to if you were renting from a hoster
    7. Again, I'm here for help, not a lecture
    8. Hosting it yourself means you can easily upgrade it down the road
    9. You also learn more about computers
    10. Renting lowkey promotes the idea of P2W. Poor renters can't pay rent - so they offer P2W ranks. I've seen this over and over again
    11. Renting places your server in the hands of a third party. All problems caused and associated with the hoster is completely out of your control and you must depend on support tickets or the such and wait for them to fix your problem
    12. Hosting yourself gives you an extreme amount of flexibility on what you can do with your server. You're not confined or restricted from doing certain things
    13. Lots of renters host in generic, populated places like Austin TX, New York NY, Etc. Home-hosting would provide nice ping for a broader range of players that are further away from such populated areas
    14. It's fun to do everything from scratch! I only made my server within 2 months with completely no former experience and it's doing very well. The only problem at the moment is not a large player-base (a rented service aint gonna fix that problem)
    15. I'm sure theres more key reasons why I wouldn't rent, but
    16. Oh yeah, some servers come with things like Watermarks in the server title, description, auto announcements, etc. You'd have to pay a premium to remove it


    Again, I'm sure theres more reasons why but I'm not on these forums to give and recieve lectures. I'm here to get some help - Even if I were renting that wouldn't have helped this post at all and I'm not sure why you brought it up
     
    • Funny Funny x 14
    • Like Like x 1
    • Agree Agree x 1
    • Optimistic Optimistic x 1
  15. If you already have the computing power at home, you might as well use it ¯\_(ツ)_/¯

    *EDIT*

    To actually contribute to the topic...

    Java in the task manager will use more than /lag does because it's Java. It shouldn't be anything to worry about, but you can try to use some garbage collector flags here:
    https://aquifermc.org/threads/optim...kes-fix-tps-improve-performance.101/#post-822

    Also just for Spigot optimization in general:
    https://www.spigotmc.org/threads/⚡server-optimization⚡remove-lag-⚡.283181/
     
    #15 Johnanater, Feb 11, 2018
    Last edited: Feb 11, 2018
  16. Thanks John (did you just happen to come over and find me on spigot or do you legitimately help people on spigot?)
     
  17. *cough* most every server with a decent playerbase rents *cough*

    Related to the OP, you need to find a way to optimize those plugins by
    A) Getting a different plugin that may have less features, but supplies the functionality you're looking for.
    B) Changing up configs of those plugins
    or C) Making your own plugin with the sole purpose of what you want it to do.

    Also, never use Task Manager when looking at RAM (unless you have a linux machine that supports top or htop). Always use timings.
     
  18. How do you know its a plugin causing it? I never said anything about plugins when reading off my RAM usage
     
  19. Well, if you run a server without any plugins with 1.82GB RAM, it doesn't have any problems.

    With 72 plugins (A LOT!) and only 1.8GB of RAM, you're going to have problems.
    My suggestion is to remove AutoSaveWorld or allocate more memory.
     
  20. electronicboy

    IRC Staff

    1. React more often than not causes more performance issues then it fixes.
    2. You're using Paper, where the save mechanism is incremental as opposed to attempting to save everything at once, you're basically undoing a lot of the performance improvements around that by using a plugin to save the world.
    3. "memory in java doesn't work how you think it works" if you allocate X amount of memory, java is going to use X amount of memory. Java doesn't only care about live objects in its memory information, it only cares about what is allocated into the heap, and will carry on allocating objects into the heap until it determines that it needs to run a collection. If you actually have some issues around running out of memory, you either have a memory leak, or you're quite simply just not allocating enough. In the former, take a heap dump and see what's going on, in the latter, throw more ram at it.



    only for websites, for TCP connections you're kinda screwed as it would require a dedicated port and stuff, and if you want to retain IPs of clients, it requires even more work.
    Your ISP deals with the costs of peering, most often than not, ISPs generally have limits or fair usage policies about how much traffic you can use in so long before they throttle you.
    Because they generally get amazing offers for shoving their DCs there, but location really isn't as important as peering, your ISP is more likely to have better peering with somewhere like level3 who do the whole "around the world and the country" thing, than directly peering with other ISPs. latency really boils down to where your mates are in the world and the network between the two.

    if you wanna home host, go for it, but colo/renting is generally a good option for various reasons, it's not inherently bad so long as you don't go for a bad provider.
     
    • Like Like x 1