TBitmap memory allocation



Hi NG,

I have a problem; I'm working on a project where we need to allocate a
lot (up to some 5000) TBitmaps, usually very small ones, and feed them
with data from some files.
What we see is some strange errors (often when running this in the
debugger, Delphi is closed with no error message). This has happened
as we have increased the number of bitmaps allocated.
I have tried to measure how much memory is allocated from each
TBitmap; my result is 165 bytes on average, no matter the bitmap's
size. This is of course nonsense and I see it as Delphi is unable to
read how much memory the winAPI allocates for each bitmap, but only
sees its own handle. So question one: How do I read how much memory
that is REALLY used by my program, using Delphi 6?
As we see this as a memory problem, we tried to upgrade a test PC from
512 MB to 1 GB RAM just to see if it would solve the problem. It did
not, the same thing happens, at the same amount of bitmaps loaded (I
cannot say excactly how many this is, but it is around 2000 TBitmaps).
I tried to use ctrl+alt+del to watch how much free memory there was in
Windows, and it looked fine even when my program crashed. So question
two: Does anyone have any idea what is going on here?
And finally question three: What do I do? :S

/Nic
.



Relevant Pages

  • Re: TBitmap memory allocation
    ... I'm working on a project where we need to allocate a ... >as we have increased the number of bitmaps allocated. ... >read how much memory the winAPI allocates for each bitmap, ... >cannot say excactly how many this is, but it is around 2000 TBitmaps). ...
    (comp.lang.pascal.delphi.misc)
  • TBitmap memory allocation
    ... I'm working on a project where we need to allocate a ... as we have increased the number of bitmaps allocated. ... I have tried to measure how much memory is allocated from each ... cannot say excactly how many this is, but it is around 2000 TBitmaps). ...
    (comp.lang.pascal.delphi.misc)
  • CreateBitmap
    ... like 500 MB out of 1000 MB of total system memory free. ... I can also allocate a 50meg char* block with with out any problems either. ... At the time I get the failure I do have about 8 other of these bitmaps in ...
    (microsoft.public.win32.programmer.gdi)
  • Re: Is there a maximum contiguous memory allocation?
    ... but could ALLOCATE it! ... allocate it if I had 2GB of physical memory! ... the amount of physical memory I have installed. ... Note that you can use raw VirtualAlloc to improve your ...
    (microsoft.public.vc.mfc)
  • Tru64 issues with Infinite limits
    ... An automated test in my nightly build was failing due to Out of Memory ... Cannot allocate block 146 ...
    (comp.unix.tru64)