Erlang/OTP Forums

Author Message

<  Erlang questions mailing list  ~  Unload unused modules

Guest
Posted: Sun Nov 08, 2009 7:44 am Reply with quote
Guest
Is there any way to unload unused module?

I've been testing how many modules can be loaded to erlang. I came up to
little less than 750 modules of 217.5 KB each. So beam.smp consumed 800
MB of memory.

Now I'm sure that some of the loaded modules will not be used at least
for a long time. How can I unload them?

Dmitry Belyaev


________________________________________________________________
erlang-questions mailing list. See http://www.erlang.org/faq.html
erlang-questions (at) erlang.org

Post received from mailinglist
vladdu
Posted: Sun Nov 08, 2009 12:26 pm Reply with quote
User Joined: 28 Feb 2005 Posts: 397 Location: Gothenburg, Sweden
Hi!

On Sun, Nov 8, 2009 at 08:42, Dmitry Belyaev <rumata-estor@nm.ru> wrote:
> Is there any way to unload unused module?
>
> I've been testing how many modules can be loaded to erlang. I came up to
> little less than 750 modules of 217.5 KB each. So beam.smp consumed 800
> MB of memory.
>
> Now I'm sure that some of the loaded modules will not be used at least
> for a long time. How can I unload them?

Yes, code:delete/1 and code:purge/1. If you know nobody uses tha code,
the latter will also clean up the memory.

regards,
Vlad

________________________________________________________________
erlang-questions mailing list. See http://www.erlang.org/faq.html
erlang-questions (at) erlang.org

Post received from mailinglist
View user's profile Send private message
Guest
Posted: Sun Nov 08, 2009 12:38 pm Reply with quote
Guest
Thank you. I searched for "unload" but there is "remove" in docs.

On Sun, 2009-11-08 at 13:24 +0100, Vlad Dumitrescu wrote:
> Hi!
>
> On Sun, Nov 8, 2009 at 08:42, Dmitry Belyaev <rumata-estor@nm.ru> wrote:
> > Is there any way to unload unused module?
> >
> > I've been testing how many modules can be loaded to erlang. I came up to
> > little less than 750 modules of 217.5 KB each. So beam.smp consumed 800
> > MB of memory.
> >
> > Now I'm sure that some of the loaded modules will not be used at least
> > for a long time. How can I unload them?
>
> Yes, code:delete/1 and code:purge/1. If you know nobody uses tha code,
> the latter will also clean up the memory.
>
> regards,
> Vlad
>



________________________________________________________________
erlang-questions mailing list. See http://www.erlang.org/faq.html
erlang-questions (at) erlang.org

Post received from mailinglist
timrila
Posted: Tue Jun 12, 2012 9:17 am Reply with quote
User Joined: 28 Mar 2012 Posts: 32
Nice article, great!I like it, thanks for sharing it with us. its worth reading! keep posting like this! thanks for sharing the great ideas.
Soccer Jerseys
Spain Soccer Jersey
Netherlands Soccer Jersey
Real Madrid Jersey
View user's profile Send private message

Display posts from previous:  

All times are GMT
Page 1 of 1
This forum is locked: you cannot post, reply to, or edit topics.

Jump to:  

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum