Re: Is Greenspun enough?



On Mon, 05 Dec 2005 18:21:37 +0100, Ulrich Hobelmann
<u.hobelmann@xxxxxx> wrote:

>George Neuner wrote:
>> On Mon, 05 Dec 2005 08:31:03 -0500, George Neuner
>> <gneuner2/@comcast.net> wrote:
>>
>>> In fact it's pretty normal to _have_ to modify the library startup
>>> functions to set up heap and so forth, but I've never seen a custom
>>> implementation of a standard library routine done for any other
>>> purpose than embedded.
>>
>> Should have added "other than alloc/free and their ilk" which are
>> reimplemented over and over by C programmers all the time.
>
>I usually only layer on top of them for convenience. But should I ever
>like a single malloc, I'd probably want to write a faster version (well,
>also layering on malloc, which I'd use to get maybe 100k blocks).

I've written several custom allocators from scratch for realtime use
on various platforms, including a cute 2 dimensional tiled allocator
for a proprietary image processor, but for desktop/server apps the
most I have ever needed to do is preallocate arrays of objects and do
ring, stack or list management on the arrays [a driver might need the
array memory to be non-pageable]. But I would only bother if the
situation could not be handled by the default language or OS
allocator(s).


>I assume a substantial fraction of memory waste (pardon, usage) and
>runtime originates from mallocing stuff, filling values in, moving them
>around, and then maybe deleting stuff again (but most programs don't
>seem to bother, be it in Java, C++, or even Aquamacs; their mem usage
>increases until I restart them once they reach 100-200 MB). The part of
>an application that actually *does* something must be a fraction.

Applications tend to monotonically increase their range of reserved
virtual addresses ... precious few ever bother to release unused pages
back to the system. Unless the application tracks and reports on its
true memory usage [e.g., logging GC], there is usually no way to tell
how much of the system reported reserved range is really in use.

George
--
for email reply remove "/" from address
.



Relevant Pages

  • custom allocation and custom type
    ... I am trying to create a custom tuple type. ... custom memory region, which will be a memory-mapped file. ... I return, to ensure it lives on, but I am getting an occasional crash ... persttupleobject.o:persttupleobject.c: undefined reference ...
    (comp.lang.python)
  • Re: Custom Form Memory Hole?
    ... > with their own custom form. ... > certain machines open or create a new item using these custom forms - the ... > 300K of memory up to using 200MB of memory, ... two WinXP computers (one of which is affected, ...
    (microsoft.public.office.developer.outlook.forms)
  • Re: overriding functions
    ... Eric Sosman wrote: ... By custom, I mean it was something that was written in-house because at the time this function did not exist in the standard library. ... crashing unpredictably inside the memory allocation functions. ... malloc() and friends, but that one module had been overlooked ...
    (comp.lang.c)
  • Re: Best way of copying a single file to multiple directories
    ... Turns out I need a custom php.ini file in each ... >directory that contains php files to sort out a default max memory ...
    (alt.php)
  • Re: Compute an Average by category
    ... Why don't you filter that column as well, use custom and not equal to 0, ... that will hide zeros ... blanks are never included unless you use arrays and this wouldn't be that ...
    (microsoft.public.excel)