Hi,

I have visual basic 6 program which loading and saving a big .bmp file.

This is the bizarre thing:

It runs okay (although slow) in windows xp with Intel Pentium 1.5 Ghz processor and 512 Mb of RAM.

So, logically it will run okay and faster in windows xp with Pentium 4 2.80 Ghz processor and 1 Gb of RAM. But it is not the case.
I cannot even load a picture with it.. and it keeps on saying:

Run-time error '7':

Out of memory

and then it will quit from the software.


-----------------------------------

I know that "better" computer is running much slower than normal.
Sometimes I need to wait to open a folder :(

What can I do to fix this problem? this is so bizarre..
I cannot reinstall the entire windows.. because I have microsoft visio in it, and apparently I lost the original cd :(

thanks

Dani AI

Generated

Short expert summary and practical checklist (notes tied to the thread)

A 32‑bit VB6 process can still hit an address‑space limit even on a faster box with more RAM — Windows gives a 32‑bit user‑mode process ~2 GB by default (can be changed only with /3GB or IMAGE_FILE_LARGE_ADDRESS_AWARE on special setups). This is an address‑space limit, not physical RAM; large bitmaps and runtime/GDI overhead easily exhaust it. [Memory limits for Windows]. (learn.microsoft.com)

A .bmp on disk is not the whole story: an uncompressed BMP expands into scanlines in memory (each scanline is DWORD‑aligned). The bitmap footprint is roughly ((bitsPerPixel width + 31) / 32) 4 * height bytes; VB/GDI and the VB runtime often make extra copies (stdPicture, DIBSections, ImageList entries), so a 5 MB file can use many times that while being manipulated. See the DIB/GetDIBits sizing discussion. (stackoverflow.com)

Quick diagnostic checklist (do these in order)

  • Verify whether Paint or Explorer can open the same BMP on the slow machine — if Paint fails, this is OS/driver/pagefile level.

  • Reproduce with a tiny test that just calls LoadPicture (isolates app logic). Example VB6 test:

    Dim p As StdPicture
    Set p = LoadPicture("C:\path\big.bmp")
    MsgBox "loaded"
    Set p = Nothing
  • While reproducing, monitor the process’ Private Bytes / GDI Objects (and handle counts) with Process Explorer to see whether the VB6 process or something else is exhausting resources. [Process Explorer]. (learn.microsoft.com)

  • Check virtual memory (pagefile) and ensure Windows is allowed to manage it or set a reasonable fixed size; also run SFC to rule out corrupt system DLLs. Windows’ virtual‑memory docs explain the steps.

Practical mitigations

  • Free picture objects explicitly in long‑running code (Set picture = Nothing / unload forms) — VB/VBA sometimes needs explicit release to avoid OOM. (stackoverflow.com)
  • If exact pixels must be kept, consider loading/processing images in tiles or using a compressed lossless format (PNG/TIFF) or a GDI+/streaming loader instead of keeping full unscaled bitmaps in memory.
  • As suggested, run a second‑opinion malware scan; as warned, avoid registry cleaners. If the app must handle many huge images regularly, moving to a 64‑bit host or making the program large‑address‑aware (advanced, test thoroughly) will remove the 2 GB user‑space bottleneck. (learn.microsoft.com)

If the thread’s OP () can add the BMP’s pixel dimensions and whether Paint opens it on that machine, the checklist above points to the most likely causes and the fastest checks.

Recommended Answers

All 12 Replies

Have you scanned it for malware recently? If you have, with what software?

I have trend micro antivirus installed in the machine..
And every week or so, it will automatically scan the entire computer for virus, and maybe for malware too.

Trend micro does antivirus scanning only, what antimalware have you got?

No, I don't have any anti malware. What's anti malware that you recommend? Only the malware scanner will do. Since, I don't want to download a virus instead, if someone put it as the anti malware name.

You can also look into doing what is written here;

I would forgo the registry cleaning though.

thanks, for comctl32.ocx and fm20.dll.
By the way regcure which is linked by that page works wonder.. I got more than 349 errors and still counting.. I hope it will fix my problem, thanks

In regards to your 'Out of memory' problem, I think the file you are saving is far too big for the program to save/open!

.bmp files are incredibally huge sometimes which drains high amounts of resources to open/save them.

Next time, try to make the file smaller!

javanoob101

thanks for the reply :) I have not used the registry cleaner yet.
I just replaced some of the .dll, but it is still cause a problem.

the .bmp file is huge (around 5 mb), but I really need to keep precision and quality of the picture. So, I am afraid that .jpeg is not really an option for it :(

Oh Well...

Good luck with it in the future!

(Hope you can fix your problem!)

javanoob101

yes.. the easiest solution is not letting that computer to access the program at all :) it only happens in that computer by the way.. the rest (even the slower one) are good. Maybe since that computer is only be used 1-2 hrs a week, so it is degrading... lol...

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.