Quick question about player HashMaps

Discussion in 'Plugin Development' started by Jake0oo0, Apr 25, 2013.

Thread Status:
Not open for further replies.
  1. Offline


    When using a hashmap like <Player, Player>, as long as you remove the player on logout, or clear the hashmap on disable, there should be no issues with memory leaks correct?
  2. Offline

    Sagacious_Zed Bukkit Docs

    Having values that are players is not a good idea, only because it is order n to remove values.
  3. Offline


    Not correct. Store the player-names and use getPlayerExact(name) instead.
  4. Offline


    Yeah, instead of doing Player, Player, do String, String and use <player>.getName().
    Storing strings is a lot more lightweight than storing objects.
  5. Offline


    A String is an Object, an like every other Object in java it is only stored one time, and then referenced
Thread Status:
Not open for further replies.

Share This Page