Re: Dynamic Room Creation/Deletion

From: George Greer (greerga@circlemud.org)
Date: 07/11/00


On Tue, 11 Jul 2000, AndaerMUD wrote:

>In an effort to curb the amount of memory my mud takes
>up, I want to use dynamic rooms. To test the effects
>of it, I created 200 rooms using OLC and saved it. The
>amount of memory I took went from 1.8% -> 2.4%. Then I
>deleted those 200 rooms using OLC's delete_room
>function. However, my memory usage only went from 2.4%
>down to 2.3%. Anyone know what's going on? Is the
>Oasis function not clearing or free()'ing everything
>possible or are the deleted rooms going to always take
>up that space no matter what?

Your process doesn't necessarily give up the memory because you called
free() on it.  The C library generally has a threshold at which it will
give up the memory but it's not instant or a small value.  If it gave it up
immediately it might have to request it all over again from the kernel in
the next line of code.

See:
/usr/info/libc.info-3.gz:    `M_TRIM_THRESHOLD'
/usr/info/libc.info-3.gz:    `M_MMAP_THRESHOLD'

If you're using GNU Lib C.

--
George Greer
greerga@circlemud.org


     +------------------------------------------------------------+
     | Ensure that you have read the CircleMUD Mailing List FAQ:  |
     |  http://qsilver.queensu.ca/~fletchra/Circle/list-faq.html  |
     +------------------------------------------------------------+



This archive was generated by hypermail 2b30 : 04/10/01 PDT