I'd use either one except that [quoting Tim Harper]
once a symbol is allocated, it is never garbage collected.
This opens up a potential DOS attack: if you convert any user input to
symbols (via #to_sym or #intern), they could easily fill your symbol
space up and eat all of the available system memory.
We'd all be wiser than I was a few minutes ago to keep this present when
deciding whether to use symbols or strings:
In message "Re: Comparing String with Symbol" on Fri, 9 May 2008 00:43:19 +0900, Roger Pack <rogerpack2005@gmail.com> writes:
I'd use either one except that [quoting Tim Harper]
once a symbol is allocated, it is never garbage collected.
This opens up a potential DOS attack: if you convert any user input to
symbols (via #to_sym or #intern), they could easily fill your symbol
space up and eat all of the available system memory.
That's true but there are some other ways for potential DOS attack,
which I don't disclose here. So you don't have to worry too much.
Anyway, I have a plan to make Symbol garbage collected in 1.9 near
future.
I'd use either one except that [quoting Tim Harper]
once a symbol is allocated, it is never garbage collected.
This opens up a potential DOS attack: if you convert any user input to symbols (via #to_sym or #intern), they could easily fill your symbol space up and eat all of the available system memory.
We'd all be wiser than I was a few minutes ago to keep this present when deciding whether to use symbols or strings:
Thanks a lot for that explanation. Finally I'll use only symbols and force
method arguments to be symbols.
Parameters will only be created via coding andnot via HTTP request and so.
Thanks a lot.
···
El Jueves, 8 de Mayo de 2008, Roger Pack escribió:
> I'd rather use to_sym instead of to_s.
>
> matz.
I'd use either one except that [quoting Tim Harper]
once a symbol is allocated, it is never garbage collected.
This opens up a potential DOS attack: if you convert any user input to
symbols (via #to_sym or #intern), they could easily fill your symbol
space up and eat all of the available system memory.
We'd all be wiser than I was a few minutes ago to keep this present when
deciding whether to use symbols or strings:
~ - You know you've been hacking too long when...
...you find out that you can't get to sleep, because you are, in fact,
the program you're designing, and can't run to completion as the lower
level routines haven't been coded yet. [This may be one of the
disadvantages of top-down design...]
In the PragProg Advanced Ruby Studio today, we were discussing profiling tools with Chad Fowler and Dave Thomas. Neither are aware of memory profiling tools for Ruby. Are there any mature memory profiling tools out there already? A quick google search turns up some old hits or small profiling apps.
Specifically, I was wondering about graphical memory profiling tools. GraphViz seems an obvious approach.
Although recent research seems to agree with you this seems to be a
bold statement nevertheless
or do you mean memory, sorry could not resist.
Cheers
Robert
···
On Thu, May 8, 2008 at 8:16 PM, Phillip Gawlowski <cmdjackryan@googlemail.com> wrote:
-----BEGIN PGP SIGNED MESSAGE-----
Space is a finite resource. Sooner or later, that code *will* consume
all available memory.
In the PragProg Advanced Ruby Studio today, we were discussing profiling tools with Chad Fowler and Dave Thomas. Neither are aware of memory profiling tools for Ruby. Are there any mature memory profiling tools out there already? A quick google search turns up some old hits or small profiling apps.
Specifically, I was wondering about graphical memory profiling tools. GraphViz seems an obvious approach.