TBitmap memory allocation
- From: nic@xxxxxx (Nicolai Hansen)
- Date: 20 Jul 2005 02:16:22 -0700
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
ps - sorry if this is double posted (Google Groups+my poor company NW)
.
- Follow-Ups:
- Re: TBitmap memory allocation
- From: Nicholas Sherlock
- Re: TBitmap memory allocation
- Prev by Date: TBitmap memory allocation
- Next by Date: Re: TBitmap memory allocation
- Previous by thread: Re: TBitmap memory allocation
- Next by thread: Re: TBitmap memory allocation
- Index(es):
Relevant Pages
|