• 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

    • Neat and welcome functionality...
    • Hey, some don't give a damn about STDs and gain pleasure from living animalistic lifestyles. Different strokes for different folks...
    • Halo Studios is teasing a big reveal for the series this October by Pulasthi Ariyasinghe Halo Studios, formerly 343 Industries, is preparing to reveal what it has been working on since the release of Halo Infinite. Other than providing support for existing Halo works, like Master Chief Collection and Infinite, the Xbox first-party studio has been rather quiet about its next releases since 2021. In its monthly blog post on Halo Waypoint, the developer had a special section regarding its future plans and dropped a pretty heavy teaser about an October announcement. Just like at the 2024 Halo World Championship, this year, the studio is planning another special announcement for fans. "Over the past few weeks, there’s been a fair amount of speculation about when and where more details might emerge about any of the multiple projects Halo Studios is actively working on," says the studio. "We don’t usually comment on such matters, but this time we want to enter the chat and share a little more perspective for Halo fans who might be on the fence about whether to attend this year’s event." In October of last year, 343 Industries, the development team that has been making games in the series since Halo 4 in 2012, went through a major rebranding to become Halo Studios. While no exact details were given, alongside a teaser video, the studio said then that multiple projects were currently in development but are years away from being released. It also revealed last year that the Slipspace Engine it developed for Halo Infinite is also being left behind in favor of Unreal Engine 5. "Speculation is always fun, but if you want the official scoop on what Halo Studios has been working on, you won’t want to miss this year’s Halo World Championship," added the studio. "We really hope you’ll join us in Seattle this October!" The 2025 Halo World Championship is slated to take place on October 24 in Seattle. Halo will be turning 25 years old in 2026, and it's likely that a new game or a remaster project will be revealed during this event.
    • I enjoy using Discover Weekly. I have found new music using it. Just sometimes it goes off the rails and doesn't remember I don't like rap. I'm not sure this update is anything helpful, but I guess I'll try it if it comes to free accounts.
  • Recent Achievements

    • Week One Done
      dennis Nebeker earned a badge
      Week One Done
    • One Year In
      timothytoots earned a badge
      One Year In
    • One Month Later
      CHUNWEI earned a badge
      One Month Later
    • Week One Done
      TIGOSS earned a badge
      Week One Done
    • First Post
      henryj earned a badge
      First Post
  • Popular Contributors

    1. 1
      +primortal
      464
    2. 2
      +FloatingFatMan
      193
    3. 3
      ATLien_0
      165
    4. 4
      Xenon
      78
    5. 5
      wakjak
      72
  • Tell a friend

    Love Neowin? Tell a friend!