[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: RE: Functions and memory usage
- From: John Donovan <JohnD@...>
- Date: Thu, 17 Oct 2002 16:39:14 +0100
Yes, I've allocated a portion of memory just for Lua's use. You have to
override sbrk in the dlmalloc code. Right near the bottom of dlmalloc.c
there is a Win32 version, and a MacOS version commented out. I used that one
as a starting point.
Programmer - Magenta Software Ltd.
> -----Original Message-----
> From: Benoit Germain [mailto:email@example.com]
> Sent: 17 October 2002 16:30
> To: Multiple recipients of list
> Subject: RE: Functions and memory usage
> I use dlmalloc too, and I have slightly modified it so that I
> can manage
> several memory pools. That way, I ensure that fragmentation
> won't affect the
> entire RAM, but will be confined to some area of my choosing.
> All I have to
> do is dedicate one pool to LUA, et voilà :-).
> > -----Original Message-----
> > From: terenctb [mailto:firstname.lastname@example.org]
> > Sent: jeudi 17 octobre 2002 08:12
> > To: Multiple recipients of list
> > Subject: Re: Functions and memory usage
> > Hi,
> > We are did try to use dlmalloc to replace the regular malloc but it
> > didn't seem to make much difference...well other than the
> fact we are
> > probably doing something wrong anyway ;-)>
> > I also found out(not sure if the info that valid) that the dlmalloc
> > is the same one used by in linux anyways so it seemed kinda
> silly to
> > replace it.
> > Terence
> > --- In lua-l@y..., Luiz Henrique de Figueiredo <lhf@t...> wrote:
> > > >I think a lot of fragmentation problems are down to the
> > > >algorithm. There is some useful info here and I think this
> > allocator
> > > >looks pretty good. I think I pulled it off this list a
> while ago.
> > Its
> > > >fast and should be good for a scripting system allocating and
> > > >deallocating little blocks of similar sizes.
> > > >http://g.oswego.edu/dl/html/malloc.html
> > >
> > > We'd be very interested in knowing whether simply replacing the
> > system malloc
> > > and friends by dlmalloc (the one at the URL above) helps. It's
> > difficult for
> > > us to test memory allocation pattern in typical, real-life cases.
> > So, someone
> > > with memory fragmentation problems or suspicion of such,
> could you
> > please try
> > > dlmalloc and see if makes any difference? Please report here.
> > Thanks.
> > >
> > > Another thing: Lua typically does not deallocating little
> blocks of
> > similar
> > > sizes: strings and userdata allocated their "data" arrays right
> > after the
> > > "header" part.
> > > --lhf
The content of this message and any attached file are confidential and/or
privileged and are for the intended recipient only. If you are not the
intended recipient, any unauthorised use, disclosure, copying, distribution
or other dissemination is strictly prohibited. If you receive this message
in error please notify the sender immediately by email, telephone or fax and
then delete this email. Any attachment with this message should be checked
for viruses before it is opened. Magenta Software Limited cannot be held
responsible for any failure by the recipient to check for viruses before
opening any attachment. Copyright in this email and attachments created by
us belongs to Magenta Software Limited. Should you communicate with anyone
at Magenta Software Limited by email you consent to us monitoring and
reading any such correspondence.