Forum: Ruby Is an embedded ruby interpreter safe to unload

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Cb75e9a5b18ad023ab1cce64e7cdebab?d=identicon&s=25 Lothar Scholz (Guest)
on 2007-03-11 00:51
(Received via mailing list)
Hello ruby-talk,

when i use ruby embedded in a program where i call "ruby_init", do a
few ruby magics and then call "ruby_finalize".

Will this free all used memory?
B74f9ac58c7a0b80d877470198e1a472?d=identicon&s=25 gga (Guest)
on 2007-03-11 10:50
(Received via mailing list)
On 10 mar, 20:51, Lothar Scholz <mailingli...@scriptolutions.com>
wrote:
> Hello ruby-talk,
>
> when i use ruby embedded in a program where i call "ruby_init", do a
> few ruby magics and then call "ruby_finalize".
>
> Will this free all used memory?
>

You want to call ruby_cleanup(0); instead, like ruby_stop() does.
ruby_finalize() does not deal with threads.
Cb75e9a5b18ad023ab1cce64e7cdebab?d=identicon&s=25 Lothar Scholz (Guest)
on 2007-03-12 01:06
(Received via mailing list)
Hello gga,

>>
>> Will this free all used memory?
>>

g> You want to call ruby_cleanup(0); instead, like ruby_stop() does.
g> ruby_finalize() does not deal with threads.

Thanks,

i looked at the source and realize that there is no way to cleanly
shutdown the ruby interpreter. This will just call all registered exit
functions.

Very very bad because this means it's very hard to use memory leak
checking
tools for extensions or much worse for systems that use ruby as an
embedded
interpreter.
This topic is locked and can not be replied to.