String Memory Usage
#1

I am trying to figure out which method of using a string would use the least amount of memory.

So basically, my string that holds my list of commands that are displayed in a dialog by the command "/cmds" is currently over 800 characters long. With a string that large my original thinking was that I should make it a global string and store the list of commands on initialization so they are simply accessible by everyone from only one variable.

Now I am starting to think in reverse and I am wondering if it eats up more memory to have that one large string sitting unused until someone requests the command dialog but I'm not sure if creating the string every time someone uses "/cmds" would use more or less memory, because if multiple people do that command at the same, I now have several large strings being stored.

What I'm wondering is if once the string is created in command and shown, is it then destroyed as soon as the command finishes, or is it still in memory until the dialog closes? If it's destroyed then I believe that it would use less memory.
Reply


Messages In This Thread
String Memory Usage - by admiralspeedy - 16.07.2014, 18:46
Re: String Memory Usage - by admiralspeedy - 16.07.2014, 19:25
Re: String Memory Usage - by KayJ - 17.07.2014, 12:00
Re: String Memory Usage - by admiralspeedy - 17.07.2014, 14:39
Re: String Memory Usage - by codectile - 17.07.2014, 15:26
Re: String Memory Usage - by admiralspeedy - 17.07.2014, 18:25

Forum Jump:


Users browsing this thread: 1 Guest(s)