[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

not enough memory

Posted on 1998-12-10
6
Medium Priority
?
187 Views
Last Modified: 2010-04-04
hallo,

i have a program under D3 and WIN98 which loads
a lot of small bitmaps into memory. And some times i get the
system messages:"Not enough memory space free" and
my program breaks down.
i think there is no function like memavail to find out
how many bytes of memory are free, - or ??
The TMEMORYSTATUS (with globalmemorystatus-function) gives not back the correct value that i need.
What can i do, to stop my loading of bitmaps before
the message arrives ?

any idea ??

thanks
titz
0
Comment
Question by:titz
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
6 Comments
 
LVL 3

Expert Comment

by:williams2
ID: 1350390
You should use a MemoryStream to keep track of your bitmaps. In this way the system will handle virtual memory automatically. (That's indeed what Borland claims)

Regards,
Williams
0
 
LVL 20

Expert Comment

by:Madshi
ID: 1350391
titz,

if it really is a memory problem, then there's surely a bug in your sources. Normally you shouldn't get such error messages in a bug-free program.
The other possibility is, that the problem is not the memory, but the gdi/handle resources. If you're loading a lot of bitmaps in TBitmap, each and every bitmap will have it's own handle. The solution for this problem would be to use an TImageList instead of single bitmaps.
To check whether you have a gdi/handle resources problem, you can download my freeware utility program "showRes.exe" from my homepage "http://beam.to/madshi". It does nothing but show you the current amount of free handles in percent.

Regards, Madshi.
0
 
LVL 1

Author Comment

by:titz
ID: 1350392
Hallo Madshi,

it seems that you are right: with your tool i saw that the GDI- and system-Resources went down to 0%.
You will have the points. But tell me: what API-Function uses your tool ?

thanks
titz

0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 8

Expert Comment

by:ZifNab
ID: 1350393
can't you put your coding in try except end?
0
 
LVL 20

Accepted Solution

by:
Madshi earned 200 total points
ID: 1350394
titz,

hmmm. It's quite complicated. I'm using thunking mechanism to call the 16bit API "GetFreeSystemResources" from the 16bit dll "user.exe". I really don't know why Microsoft didn't implement a 32bit version...   :-(

Regards... Madshi.

P.S: Everything clear with the TImageList?

Hi Zif, putting this all into a try..except would not really help. The real problem is that titz consumes too many handles...
0
 
LVL 1

Author Comment

by:titz
ID: 1350395
thanks mdshi,

i often thought the same: why is this function not implemented in 32bit ?

have a sunny day !
titz
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction The parallel port is a very commonly known port, it was widely used to connect a printer to the PC, if you look at the back of your computer, for those who don't have newer computers, there will be a port with 25 pins and a small print…
In this tutorial I will show you how to use the Windows Speech API in Delphi. I will only cover basic functions such as text to speech and controlling the speed of the speech. SAPI Installation First you need to install the SAPI type library, th…
Add bar graphs to Access queries using Unicode block characters. Graphs appear on every record in the color you want. Give life to numbers. Hopes this gives you ideas on visualizing your data in new ways ~ Create a calculated field in a query: …
In this video, Percona Solution Engineer Rick Golba discuss how (and why) you implement high availability in a database environment. To discuss how Percona Consulting can help with your design and architecture needs for your database and infrastr…
Suggested Courses

649 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question