ferrybig
Last Activity:
Oct 20, 2016
Joined:
Jul 15, 2011
Messages:
3,667
Likes Received:
289
Trophy Points:
0
Gender:
Male

Share This Page

ferrybig

Member, Male

ferrybig was last seen:
Oct 20, 2016
    1. chasechocolate
      chasechocolate
      omg 2,999 messages :O
    2. pollag
      pollag
      I post the error
    3. thehutch
      thehutch
      About your signature? Since a Map/List/Set are pointers and only a reference to the object therefore if you edit the object outside the map then it'll be reflected in the Map/List/Set etc... So when the player logs out and the object is nulled, it'll be null in the Map/List/Set? Unless you stored your own Player object in which case their stupid :D
      1. ferrybig
        ferrybig
        when you null the objecxt, it wont reflect inside the map, consider doing this example:
        [syntax=java]
        Map map = new HashMap<String,String>
        String value = "b";
        String key = "a";
        map.put(key,value);
        value = null;
        System.out.println(map.get(key));[/syntax]It will print out "b", even the value is nulled out
        Nov 11, 2012
      2. thehutch
        thehutch
        Have you tested that? Because I'm sure it'll say null. Give me 5 mins and i'll test it...
        Nov 11, 2012
      3. thehutch
        thehutch
        Ok well it appears I have been mislead about some information about Maps :( It does appear that Maps are not pointers then :( I'll have a word to Afforess about this since he told me
        Nov 11, 2012
    4. monster860
      monster860
      Ultimate grammar fail! It's A missing, not AN missing :P
      1. ferrybig
        ferrybig
        so, why getting angry? you could also say it nicely, that is better for the comunity
        Jun 28, 2012
  • Loading...
  • Loading...
  • About

    Gender:
    Male

    Signature

    What's bad about saving a player's instance to the list/map/set though? (open)
    Memory leaks if stored the Collection for a long time: - Player logs off: Javas GC can't remove it cause your list/set/other still contains it. So you still have the whole instance of the player (with the IP, the real name, the display name, the list name, the health, the potion effects, other plugins metadata, ...) even if minecraft tries to save it to the disc and (tries to)unloads it from ram. - Multiworld (or some other multi world plugin) unloads the world the (maybe since two or more days... but still in your list...) logged off player was in. The GC can't remove it cause there's still that player instance in your map, which is holding the world loaded, which prevents the GC from releasing RAM...

    How to use blocking an bukkit tasks together.
    How to use event listeners
    Setting up a minecraft server inside netbeans for testing
    Make entities move faster