• 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

    • Taras Buria, do you think you could write more about Windows Vista? It is always such a pleasure — quite a pleasure — to see it mentioned in the title of a news article. What about an editorial?
    • Alienware 34 240Hz QD-OLED Monitor: A premium ultrawide for serious gamers - save $100! by Paul Hill Are you a serious gamer looking to save money on a monitor upgrade? If so, check out this deal on the Alienware 34 240Hz QD-OLED Gaming Monitor (AW3425DW), which is discounted by 13% from $799.99 to just $699.99. This ultrawide monitor features a 3,440 x 1,440 pixel display and the screen is curved for added immersion. Two features that will stand out to competitive gamers are the 240Hz refresh rate and 0.03ms GtG response time which will minimize any lagging from input to display, making you a more lethal player. Why QD-OLED matters for gamers and creators This Alienware uses QD-OLED (Quantum Dot Organic Light Emitting Diode) technology which combines OLED’s self-emitting LEDs with the color-enhancing capabilities of quantum dots. This results in higher brightness, a wider color gamut, deeper blacks, and wide viewing angles. With the 1800R curve built into this display, whatever you’re immersed in will wrap around, making your games more absorbing, potentially reducing other distractions. There is also VESA DisplayHDR TrueBlack 400 certification and 1,000 nits peak HDR brightness on this display. Gamers using this monitor will be able to get the best quality picture from this monitor to improve the experience and their competitiveness. It’s also good for creators who want to edit images and videos as they will see the content they're editing in the best ways possible, so they can be totally sure it’s ready for publication. Design, connectivity, and user experience The Alienware 34 uses an updated Interstellar Indigo design which is more compact and uses a flat stand. This frees up desk space compared to older Alienware designs and still allows for height, tilt, and swivel adjustments and VESA mount compatibility. Regarding ports, this monitor features 2x HDMI 2.1, 1x DisplayPort 1.4, 1x USB 5Gbps Type-B upstream, 1x USB 5Gbps Type-A downstream, 1x USB-C 5Gbps downstream with 15W charging. The USB-C port is for data and charging, not video input and the lack of KVM switch could be a drawback for some. If you decide to pick up this monitor, according to PCWorld, it does not include in-built speakers so you will need to connect your own. This is not a big issue because gamers looking for a premium playing experience will not want to rely on subpar in-built speakers anyway. Is the AW3425DW the right fit for you? Given its curved display, quality QD-LED display technology, and its fast response time, this monitor is a great pick for serious gamers looking for top-tier performance and immersion. Content creators who value color accuracy will also do well in picking up this Alienware monitor. Alienware 34: $699.99 (Amazon US) / MSRP $799.99 This Amazon deal is US-specific and not available in other regions unless specified. If you don't like it or want to look at more options, check out the Amazon US deals page here. Get Prime (SNAP), Prime Video, Audible Plus or Kindle / Music Unlimited. Free for 30 days. As an Amazon Associate, we earn from qualifying purchases.
  • Recent Achievements

    • Rising Star
      Phillip0web went up a rank
      Rising Star
    • One Month Later
      Epaminombas earned a badge
      One Month Later
    • One Year In
      Bert Fershner earned a badge
      One Year In
    • Reacting Well
      ChrisOdinUK earned a badge
      Reacting Well
    • One Year In
      Steviant earned a badge
      One Year In
  • Popular Contributors

    1. 1
      +primortal
      545
    2. 2
      ATLien_0
      205
    3. 3
      +FloatingFatMan
      170
    4. 4
      Michael Scrip
      150
    5. 5
      Som
      131
  • Tell a friend

    Love Neowin? Tell a friend!