• 0

[VB6] Image Out of Memory


Question

Hello gang,

I am stuck keeping alive a VB6 app (that should have never been written in VB6, but that's another story) It is a medical app that stores many, many images. One user is occasionally getting an "Out of Memory. Error 7"

The error occurs here:


'vdata is the directory path
Image1.Picture = LoadPicture(vdata)
[/CODE]

The image that SOMETIMES errors is a 12 mp, however right now I have the image loaded multiple time along with other images and the application is reporting 1.2 GB of memory within Task Manager. I Googled this issue and I went looking for the specific limitations of the VB6 Image control (not the PictureBox) and came back without the specifications.

Any thoughts?

Link to comment
https://www.neowin.net/forum/topic/1050117-vb6-image-out-of-memory/
Share on other sites

6 answers to this question

Recommended Posts

  • 0

Have you tried adding extra debug to the program to see if it's directly tied to the loading of the image? Also if the program is reporting 1.2gb of memory usage, are you sure the computer it's running on has enough memory available to run the program?

  • 0
  On 09/01/2012 at 17:04, firey said:

Have you tried adding extra debug to the program to see if it's directly tied to the loading of the image? Also if the program is reporting 1.2gb of memory usage, are you sure the computer it's running on has enough memory available to run the program?

It's an external client so I have minimal access to it's tech specs. My development machine here is a POS with ony 1gb ram, so WIndows is having to use VM to get that large a load (and WOW does it show when I get it to that level)

Because it's an external client the possability to add extra debugging info is highly unlikely, besides I can see that it is the mentioned like of code (LoadPicture) and not always that image. It seems to only occur when I push the app to load more that 800mb of data.... but not always then.

  • 0
  On 09/01/2012 at 17:11, firey said:

Have you tried loading a tonne of small images versus a few huge images? That way you can see if it has anything to do with actual image sizes / memory used per image, or if it's to do with number of images loaded.

Because the person who originally wrote this did not think about memory issue I added a thumbnail creator. When a patient is loaded ALL of their procedures are loaded, each procedure can have an infinite number of media. Since this is VB6 is is not threaded and at least now there are smaller images loading (it was getting BAD!) I cannot change this to load only 5 procedures to a "page" as it would take a huge rewrite (spaghetti anyone?)

So the base question I have is if anyone knows of specific memory issues/constraints with the VB6 Image control. I do know that VB6 can only have 256 controls on a form (I think that's the right number) and the number of images the users are loaded, regardless of their size, may be causing the issue.

Thanks for your thoughts Firey.

  • 0
  On 09/01/2012 at 16:54, James Rose said:

Hello gang,

I am stuck keeping alive a VB6 app (that should have never been written in VB6, but that's another story) It is a medical app that stores many, many images. One user is occasionally getting an "Out of Memory. Error 7"

The error occurs here:


'vdata is the directory path
Image1.Picture = LoadPicture(vdata)
[/CODE]

The image that SOMETIMES errors is a 12 mp, however right now I have the image loaded multiple time along with other images and the application is reporting 1.2 GB of memory within Task Manager. I Googled this issue and I went looking for the specific limitations of the VB6 Image control (not the PictureBox) and came back without the specifications.

Any thoughts?

vdata = Directory or File path?

Just to check (not trying to be a tool or anything D: )

  • 0
  On 09/01/2012 at 17:24, articuno1au said:

vdata = Directory or File path?

Just to check (not trying to be a tool or anything D: )

File Path. My bad for not stating that better.

Additional: This app is out on the wild with this code and has been for years. I'm guessing that with higher mega pixels and more images VB6 is hitting limits.

This topic is now closed to further replies.
  • Posts

    • Generally, Earth never initiated that animals lay straight
    • Several UI improvements masquerading as a major update. I'm truly hating this trend.
    • OpenAI to use Google Cloud despite rivalry, diversifying beyond Microsoft by Paul Hill To help it meet its massive computing demands for training and deploying AI models, OpenAI is looking into a surprising partnership with Google Cloud to use its services. It was widely seen that OpenAI was Google’s biggest threat, but this deal puts an end to the idea that the pair are purely competing. The two companies haven’t made any public announcement about the deal but a source speaking to Reuters claimed that talks had been ongoing for a few months before a deal was finalized in May. Notably, such a deal would see OpenAI expand its compute sources beyond Microsoft Azure. Microsoft had arrangements in place with OpenAI since 2019 that gave it the exclusive right to build new computing infrastructure for the startup. This limitation was loosened earlier this year with the announcement of Project Stargate. OpenAI is now allowed to look elsewhere for compute if Microsoft is unable to meet the demand. A win for Google Cloud, a challenge for Google's AI strategy The deal will see Google Cloud supply computing capacity for OpenAI’s AI model training and inference. This is a big win for Google’s Cloud unit because OpenAI is a massive name in AI and it lends credence to Google’s cloud offering. It also justifies Google Cloud’s expansion of its Tensor Processing Units (TPUs) for external use. On the back of the news, Alphabet’s stock price rose 2.1%, while Microsoft’s sank 0.6%, showing investors think it’s a good move for Google too. While many end users don’t interact with Google Cloud the same way they do with something like Android or Chrome, Cloud is actually a huge part of Google’s business. In 2024, it comprised $43 billion (12%) of Alphabet’s total revenue. With OpenAI as a customer, this figure could rise even more given the massive amounts of compute OpenAI needs. By leveraging Google’s services, it will also give OpenAI access to the search giant’s Tensor Processing Units (TPUs). Unlike GPUs, these chips are specifically designed to handle the kinds of calculations that are most common in AI and machine learning, leading to greater efficiency. Google’s expansion of these chips to external customers has already helped it attract business from Anthropic and Safe Superintelligence. While Google will happily take OpenAI’s money, it needs to tread carefully giving compute power to a rival, which will only make OpenAI more of a threat to Google’s search business. Specifically, it’ll need to manage how resources are allocated between Google’s own AI projects and its cloud customers. Another issue is that Google has been struggling to keep up with the overall demand for cloud computing, even with its own TPUs, according to its Chief Financial Officer in April. By giving access to OpenAI, it means even more pressure. Hopefully, this will be short lived as companies compete to build out capacity to attract customers. OpenAI's push for compute independence Back in 2019 when Microsoft became OpenAI’s exclusive cloud partner in exchange for $1 billion, the AI landscape was much different. End users wouldn’t have access to ChatGPT for another 3 years and the rate of development of new models was less ferocious than it is today. As OpenAI’s compute needs evolve, its relationship with Microsoft has had to evolve too, including this deal with Google and the Stargate infrastructure program. Reuters said that OpenAI’s annualized run rate (the amount they’ll earn in one year at its current pace) had surged to $10 billion, which highlights its explosive growth and need for more resources than Microsoft alone can offer. To make itself more independent, OpenAI has also signed deals worth billions of dollars with CoreWeave, another cloud compute provider, and it is nearing the finalization of the design of its first in-house chip, which could reduce its dependency on external hardware providers altogether. Source: Reuters
    • I don't think that means what you think it means
    • The Google Home app gets video forwarding support and many more features by Aman Kumar Along with releasing the Android 16 update for supported Pixel devices, Google has also showcased a number of features coming to its Home app. First up is PiP, also known as picture-in-picture mode, which will be available for Nest Cams on any Google TV device you own. It’ll be similar to YouTube’s PiP, with which you must be familiar with. A small window will appear in a corner of the TV screen, allowing you to view your Nest Cams without interrupting your viewing experience. The feature is currently in public preview, and you can enroll to try it out before its public release. Another YouTube feature that Google is adding to its Home app is the ability to jump 10 seconds forward or backward in recorded videos. This feature ensures that you don't have to go through the entire footage to locate the moment you’re looking for. Google mentioned in its blog post that it is adding more controls to the Google Home web app. Currently, the web app offers limited functionality, such as setting automations and viewing cameras, but soon you’ll be able to manage more things through it, such as adjusting lighting, controlling temperature, and locking or unlocking the door. Google’s AI model, Gemini, is also getting more controls in the Home app. You can use natural language in the Gemini app to search for specific footage in the camera history. Furthermore, the fallback assistant experience that broadcast commands use is also being updated. You’ll now be able to use your voice to broadcast messages through the connected speakers in your home. The Google blog post also mentions that you are no longer required to use the standalone Nest app to receive smoke and other critical alerts. You can now view the Nest Protect smoke and carbon monoxide (CO) status directly in the Home app. You’ll also be able to run safety checkups and hush alarms through the Home app. In addition to all these features, Google is also making the automation creation process much quicker, will allow you to add more tiles to the Home app Favorites section, and will let you create different Favorites for any other device you use, such as your smartwatch. The Home app will now also support third-party Matter locks. Similar to the Nest x Yale lock, you’ll be able to control various settings of these third-party locks, like managing household access, creating guest profiles, and more.
  • Recent Achievements

    • Week One Done
      Falisha Manpower earned a badge
      Week One Done
    • One Month Later
      elsa777 earned a badge
      One Month Later
    • Week One Done
      elsa777 earned a badge
      Week One Done
    • First Post
      K Dorman earned a badge
      First Post
    • Reacting Well
      rshit earned a badge
      Reacting Well
  • Popular Contributors

    1. 1
      +primortal
      543
    2. 2
      ATLien_0
      272
    3. 3
      +FloatingFatMan
      207
    4. 4
      +Edouard
      201
    5. 5
      snowy owl
      139
  • Tell a friend

    Love Neowin? Tell a friend!