Re: Preventing memory fragmentation
From: Tron Thomas (tron.thomas_at_verizon.net)
Date: 12/28/03
- Next message: Tron Thomas: "Re: Preventing memory fragmentation"
- Previous message: Andrew Skouloudis: "Problem with linked list .."
- In reply to: Tom Plunket: "Re: Preventing memory fragmentation"
- Next in thread: Tom Plunket: "Re: Preventing memory fragmentation"
- Reply: Tom Plunket: "Re: Preventing memory fragmentation"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: 28 Dec 2003 13:18:31 -0800
Tom Plunket <tomas@fancy.org> wrote in message news:<fl8muvk1r1sjk9g7cb8cf6ngjpep0cofcn@4ax.com>...
> Did you try asking them for (or simply did you get) specifics
> beyond, "it'll fragment memory"?
This is an editted version of the e-mail thread between myself and the
person at the comapany who provided the feedback on my code:
----------
Hi Tron,
The c-runtime dynamic memory manager (and most other commercial memory
managers) has issues with fragmentation similar to a hard drive file
system.
Over time, the more often use call new/delete or alloc/free, there
will be
gaps and fragments in the heap. This can lead to inefficient use of
available memory, as well as cache-hit inefficiencies.
The goal of performance-critical applications is to minimize the
number of
calls to new/delete. Many use buffer managers that allocate blocks of
contiguous memory, and chain them together with list pointers when the
block
is consumed. Another approach is to use a Spare List, in which each
block of
memory is not actually freed but returned to a pool manager.
-----Original Message-----
Where can I find information on implementing and using buffer pools?
-----Original Message-----
Hi Tron,
One of his concerns was frequent calls to new and delete, which can
cause memory fragmentation over time. An example is the allocation and
destruction of a memory buffer for every network packet transmission,
vs.
employing a
buffer pool.
-----Original Message-----
I'm confused. What kinds of problems did my code have with memory
management?
-----Original Message-----
Hi Tron,
Thanks for the code samples. I had a chance to review them with our
technical director today. He did like the fact that you are willing
to tackle complicated problems. However, he had some concerns about
the efficiency of your code, particularly in its use of the memory
manager, and so I am unable to offer you a position at this time.
----------
If anyone on this group would be interested in looking at the code to
see if they agree with the comments above I would be more than willing
to make the code available to them.
> Is it this memory pool class you wrote that does your allocation?
> I.e. is this the memory manager that they called into question?
No, I wrote the memory manager in attempt to improve the code after
receiving the feedback.
> Your memory manager is THE naive memory manager. No offense
> intended, it's just pretty much the most basic memory manager
> that there could be.
No offense taken. I agree with you. The memory manager is naive.
After implementing it I was really wondering what I had accomplished
with it and if it was at all effective. It didn't seem to me that it
did anything more than what the default runtime memory manager for
would have been able to do. That's why I posted the code to this
newsgroup. I understood that if I requested feedback that there would
be people who would be critical of the code.
- Next message: Tron Thomas: "Re: Preventing memory fragmentation"
- Previous message: Andrew Skouloudis: "Problem with linked list .."
- In reply to: Tom Plunket: "Re: Preventing memory fragmentation"
- Next in thread: Tom Plunket: "Re: Preventing memory fragmentation"
- Reply: Tom Plunket: "Re: Preventing memory fragmentation"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|