Re: Policy on rebooting?

From: D. Zimmerman (7UPdzimmerman_at_stny.rr.com)
Date: 10/06/04


Date: Wed, 06 Oct 2004 13:08:30 GMT

Paul Keinanen wrote:

> On Wed, 6 Oct 2004 11:16:58 +0200, "mk" <REVERSE_lp.pw@myzskm.REMOVE>
> wrote:
>
>
>>Why is dynamic memory allocation bad idea?
>
>
> Fragmentation.
>
> After a few years of running the dynamic memory pool might not have 1
> KiB of _contiguous_ memory available, even if there is more than 1MiB
> of free dynamic memory scattered all a round in 1-1000 byte fragments
> and any malloc/new requests larger than 1 KiB will fail.
>
>
>>What does dynamic memory allocation have to do with virtual memory?
>
>
> With a few GiB of virtual memory, it only takes longer until the
> virtual memory is fragmented. The device might become obsolete and
> removed from service (or at least rebooted) before the whole virtual
> memory has been fragmented.
>
> With a fragmented virtual memory, the performance drops, since usually
> only part of each virtual memory page is in use, thus more pages must
> be loaded from the page file on disk, when for example accessing a
> linked list.
>
> Only if the virtual memory fragments are larger than the virtual
> memory page size, the unused pages are not loaded from the page file.
>
> Paul
>

This also depends on the operating system being used. Most
real time OS's, which are often used for embedded, will only
allocate fixed size memory blocks and will reclaim the
entire block. This prevents the problem Paul described.

Dennis,

-- 
If sending a reply you will need to remove "7UP".


Relevant Pages

  • Re: Slow Computer Response:
    ... You need to increase your RAM from 256 mb to at least 512 mb. ... To advise on adding memory we need to know more about your computer. ... History under Internet Explorer. ... Average fragments per file = 1.29 ...
    (microsoft.public.windowsxp.general)
  • Re: [00/17] Large Blocksize Support V3
    ... I found less of an issue with filesystem pagecache than with internal ... struct page with respect to memory overhead so as not to regress vs. ... and handing out MMUPAGE_SIZE-sized fragments during COW/zerofill faults. ...
    (Linux-Kernel)
  • pooling memory, accessing contiguously
    ... object that was to pool the memory allowing for contiguous access of memory ... many fragments and very large sized buffers. ... I can modify Delphi so that when it recognizes a ...
    (borland.public.delphi.language.objectpascal)
  • Re: Policy on rebooting?
    ... After a few years of running the dynamic memory pool might not have 1 ... KiB of _contiguous_ memory available, even if there is more than 1MiB ... With a few GiB of virtual memory, it only takes longer until the ... Only if the virtual memory fragments are larger than the virtual ...
    (comp.arch.embedded)
  • Re: [XFS] Kernel (2.6.11) deadlock (kernel hang) in user mode when writing data through mmap on larg
    ... > 2) XFS keeps each inode's extent map in one single memory block. ... the reasons seems to clearly be this anormal number fo fragments - ... is there any potential solution, ... send the line "unsubscribe linux-kernel" in ...
    (Linux-Kernel)