On Tue, 24 Nov 2009, Maurilio Longo wrote:

Hi,

> I'll do some tests later today and then I'll let you know.

Thank you,

> PS. When calling DosAllocMem() a 64Kb object gets allocated even for a single
> byte request. Is there something to make dlmalloc aware of this fact?
> Otherwise we could end up wasting a lot of memory.
> "Note: DosAllocMem and DosAllocSharedMem both allocate a block of memory of
> the size requested rounded up to the nearest page. On OS/2 Warp, the system
> allocates a 64K object without attributes on every allocation.
> For example, for a DosAllocMem call with a size of 1, the system allocates a
> 4096-byte block of committed memory plus 61440 bytes without attributes. "

To be more precise. It only reserves 64KB from process virtual memory
address space but allocates physical memory in 4KB pages. Quite common
situation on many systems i.e. MS-Windows system_info.dwAllocationGranularity.

DLMALLOC is memory manager which is designed to work between OS and
application so eliminating such overhead is one of its basic
functionality. And it's really good MM so I also expect that using
it should improve the performance of Harbour applications in OS/2
and reduce total memory allocated from system.
By default in OS/2 builds HAVE_MORECORE is set to 0 what causes that
MORECORE_CONTIGUOUS is also set to 0 and then DEFAULT_GRANULARITY is
set to 64K what is the expected allocation granularity in OS/2.

best regards,
Przemek
_______________________________________________
Harbour mailing list (attachment size limit: 40KB)
[email protected]
http://lists.harbour-project.org/mailman/listinfo/harbour

Reply via email to