• 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

    • Flip flop flip flop. This guy has no idea what he's doing.
    • Trump announces a 25% tariff on India, leaving smartphone manufacturers stunned by Hamid Ganji On Wednesday, President Trump announced that the US administration had decided to impose a 25 percent tariff on imported goods and products from India. The tariffs will take effect on Friday. In addition, India may face further penalties for engaging in trade with Russia, including the purchase of Russian oil. Trump said India is a friend to the United States, whose "tariffs are far too high, among the highest in the world." He also criticized India's weapons and oil deals with Russia, "when everyone wants Russia to STOP THE KILLING IN UKRAINE." India currently applies a 39 percent tariff on imported agricultural products and a 45 percent tax on vegetable oils. In response to the US's new tariffs, the Indian government said it's examining the implications of Trump's announcement while continuing the negotiations with Washington for a "fair, balanced and mutually beneficial bilateral trade agreement." The 25 percent tariff places India among the countries subject to the highest import duties when exporting to the US market. By comparison, imports from the European Union face a tariff of just 15 percent. After officially taking office, President Trump moved to further escalate the trade war with China by raising tariffs to their highest levels. As the world's leading manufacturer of smartphones for major brands such as Apple, Google, and Samsung, China's increased tariff burden was expected to drive up smartphone prices in the US market. The increase in tariffs on China has prompted an increasing number of tech companies to shift their manufacturing focus to India. For example, most iPhones sold in the US are now Indian-made, while the latest data by Canalys shows around 44 percent of all smartphones imported to the US are also made in India. While smartphone manufacturers initially hoped that shifting production to India would protect them from tariffs, the recent imposition of a 25 percent tariff has complicated the situation significantly. In April, the US government imposed a 27 percent tariff on imports from India, but later backed away from the plan. Now, however, it seems that the two sides have failed to find common ground in their trade negotiations.
    • OpenAI to build giant AI hub in Norway, tightening US grip on Europe's tech future by Paul Hill OpenAI has announced Stargate Norway, its first AI data center initiative in Europe under the OpenAI for Countries program. It has a planned 230MW capacity and is expected to host 100,000 Nvidia GPUs by the end of next year, with a significant future expansion hoped for. The site will be built by Nscale and Aker will help on the energy side of things, they will form a 50/50 joint venture, owning the site. The Stargate Norway announcement follows Stargate UAE and other partnerships, indicating that OpenAI is looking at a global strategy for its infrastructure needs. Stargate Norway will run entirely on renewable hydropower in Narvik, Norway. OpenAI cited low-cost energy, cool climate, and mature industrial base, explaining that these make it an ideal place for the project to take shape. The facility will run on 100% renewable energy and will use closed-loop, direct-to-chip liquid cooling to ensure maximum cooling efficiency. The excess heat from the GPU systems will be made available to help support low-carbon enterprises in the region. While renewable energy is often seen as an ethical choice, in the case of Stargate Norway, it is being chosen for entirely practical reasons. The data center will require loads of energy to power AI so using Norway’s hydropower makes a lot of sense. OpenAI said that the project aims to deliver on Norway’s sovereign AI goals and provide sovereign compute capacity in Europe. The announcement also stated that Aker and Nscale will provide priority access to Norway’s AI ecosystem and any surplus capacity will be available to the public and private sectors across the UK, Nordics, and Northern Europe. With the establishment of Stargate Norway, the country expects to see new jobs created, more economic activity, and AI research collaboration with local institutions. OpenAI called the deal “one of the most ambitious AI infrastructure investments in Europe to date.”
    • Because it's just a one liner fix. One person ( StartAllBack dev ) was able to fix it... in a cave!
    • I have a first draft of the setup script available here if anybody is curious.  It'll work well enough for me, but obviously adapt it to your own needs as necessary. Link: https://gitlab.com/-/snippets/4876568
  • Recent Achievements

    • Week One Done
      whiloh earned a badge
      Week One Done
    • Week One Done
      memnoch earned a badge
      Week One Done
    • First Post
      UAVXP earned a badge
      First Post
    • Dedicated
      Xinotema earned a badge
      Dedicated
    • Rookie
      MrNukes went up a rank
      Rookie
  • Popular Contributors

    1. 1
      +primortal
      661
    2. 2
      ATLien_0
      205
    3. 3
      Xenon
      133
    4. 4
      neufuse
      124
    5. 5
      Michael Scrip
      123
  • Tell a friend

    Love Neowin? Tell a friend!