Solved

loadpicture() function fails, out of memory.

Posted on 1997-06-20
6
293 Views
Last Modified: 2010-05-18
I am writing a VB5 program where I load image controls at run time, and seem to be running out of memory. The application will load about 20 image controls, then it just locks up. If I try to load another VB application I get a bunch of "out of memory" errors. However, I have 24 meg of ram, and the system performance and the resource meter say that I have about 90% memory available? what is happening? is it running into the old 640k block? is there any way to fix this? or am I limited in the number of controls I can add to a form? if I can't fix the problem, is there a way I can determine how much memory is available through VB, so that I know when I have to quit adding controls?
0
Comment
Question by:chaos@tlc
  • 3
  • 2
6 Comments
 

Expert Comment

by:Lucas041697
ID: 1427477
You reduce the resolution of the picture.
0
 

Author Comment

by:chaos@tlc
ID: 1427478
you can't reduce the resolution of an image control, and you can't change the resolution of the original image through VB. And I don't want to change the original image in any way.
0
 
LVL 2

Expert Comment

by:ChrisK
ID: 1427479
If you are attempting to load high res 24-bit images that will eat up memory in a hurry.  You can't have that many images open at the same time in your app.  The controls themselves shouldn't be to heavy on vb's memory.  So if you activate one or two images to start with, and then just load your new pictures as they are needed over the old ones,it will work, and you won't have to change your res or image color depth.
0
DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

 

Author Comment

by:chaos@tlc
ID: 1427480
ok, so why does everything else say I am only using 90% of memory? And is there any way I can tell how much memory I am using, so I can program in some limitations?
0
 
LVL 2

Accepted Solution

by:
ChrisK earned 100 total points
ID: 1427481
To my knowledge the Windows 95 mem free display isn't updated at a fast rate.  So if you alt+tab to it when you get a memory problem, chances are it hasn't updated and when a system error like out of memory accures, it can't update until the OK button is pushed, in which case the memory is then free'd up again.  There are several ocx's on the net which can tell you everything you need to know from free system memory to how much processor power your app is taking.  Visit http://pi1438.kub.nl:2080\/VisualBasicSource/scindex.htm and you will find the programs and info you seek.  Hope this answers all your questions...
0
 

Author Comment

by:chaos@tlc
ID: 1427482
Ok, so why does my system say I have only used 90% of the available memory? and if I am using up the memory, and the system simply isn't reflecting it, how can I check, using VB5, how much memory I have available?
0

Featured Post

VMware Disaster Recovery and Data Protection

In this expert guide, you’ll learn about the components of a Modern Data Center. You will use cases for the value-added capabilities of Veeam®, including combining backup and replication for VMware disaster recovery and using replication for data center migration.

Question has a verified solution.

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

Suggested Solutions

Enums (shorthand for ‘enumerations’) are not often used by programmers but they can be quite valuable when they are.  What are they? An Enum is just a type of variable like a string or an Integer, but in this case one that you create that contains…
Background What I'm presenting in this article is the result of 2 conditions in my work area: We have a SQL Server production environment but no development or test environment; andWe have an MS Access front end using tables in SQL Server but we a…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

803 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