How to reclaim memory without GC.start

On 8/5/07, Ari B. [email protected] wrote:

toying with the idea of massive variable generation, but i think that
might be a bit difficult.

So what do you all think?

Why oh why are you asking for this, Ari?

Todd

On Aug 6, 2007, at 11:22 AM, Todd B. wrote:

So what’s the best way to consume all of a computer’s RAM? I’ve been
toying with the idea of massive variable generation, but i think that
might be a bit difficult.

So what do you all think?

Why oh why are you asking for this, Ari?

This can be of great use for computers with low memory - You run this
script, it uses up all available memory, and then it exits. Guess
what happens then? GC clears out all of the RAM the ruby script was
using. And since it was using up all available RAM, other programs
can then run better and faster.

You see? Its not malicious!

-------------------------------------------------------|
~ Ari
crap my sig won’t fit

On 8/6/07, Ari B. [email protected] wrote:

I have done several scientific tests with this on World of Warcraft
This can be of great use for computers with low memory - You run this
script, it uses up all available memory, and then it exits. Guess
what happens then? GC clears out all of the RAM the ruby script was
using. And since it was using up all available RAM, other programs
can then run better and faster.

OK. I might be using up my credibility here, but …

/memory/intelligence/

You see? Its not malicious!

That’s not my intention either. The only thing that comes to mind is
“shooting themselves in the foot”?

Point being: yes, it is useful to be destructive in order to be
productive. But, do you really have to?

Todd

Ari B. wrote:

This can be of great use for computers with low memory - You run this
script, it uses up all available memory, and then it exits. Guess what
happens then? GC clears out all of the RAM the ruby script was using.
And since it was using up all available RAM, other programs can then
run better and faster.

At this moment, other programs have been painfully pushed to swap, so
they have to get out of swap before doing anything. If you want to solve
a memory management problem, don’t use a program, tune your kernel (or
swap the OS for another if it’s unable to do memory management properly,
Ruby works on a large choice of OS…).

Lionel

On Aug 6, 2007, at 1:34 PM, Todd B. wrote:

Point being: yes, it is useful to be destructive in order to be
productive. But, do you really have to?

Well, no, I don’t have to, but it would be really nice to be able to
have a bunch of free memory so my computer doesn’t stall during
another program. Is there an alternative to soaking up the RAM and
then releasing it?

-------------------------------------------------------|
~ Ari
crap my sig won’t fit

On Aug 6, 2007, at 2:55 PM, Ari B. wrote:

then releasing it?

-------------------------------------------------------|
~ Ari
crap my sig won’t fit

It’s just generally accepted that the Berkeley and MIT crowd have
figured out memory management well enough at the OS level. The best
way to free up additional memory is to run fewer apps at the same
time and tweak the OS to run less stuff in the background.

One aspect of memory management, however, is that there is just a
limit to how many apps can run smoothly at the same time on the same
machine. Even with lots of memory, you still run into limits on the
processor.

On Aug 6, 2007, at 1:55 PM, Ari B. wrote:

Well, no, I don’t have to, but it would be really nice to be able
to have a bunch of free memory so my computer doesn’t stall during
another program. Is there an alternative to soaking up the RAM and
then releasing it?

check out /dev/shm or mmap. to allocate a big string just use

huge = 0.chr * (2 ** 32)

regards.

a @ http://drawohara.com/