|
-
Feb 3rd, 2024, 08:56 AM
#4
Re: Out of memory somewhat reproducable
Personally, I think you should be looking at data you're reading into memory. You'd be very surprised at how tightly VB6 code compiles into machine language. But large arrays (Collections, Dictionaries, etc) can easily blow up memory.
Also, just other thoughts, be sure you actually are compiling to machine code, and not p-code.
Does your program compile and run in the IDE? If so, that's more evidence that it's not the amount of code you have, as it'll take much more memory to run in the IDE than it would take as a machine code compiled EXE. When loading/running in the IDE, you're still limited to 2GB, including the IDE itself, and all the compiled p-code (which is what it is) when you execute from the IDE.
Another thought is that it might be some kind of recursion-gone-wild problem, but I believe that always reports an "out of stack space" error.
Also, it's possible you're doing some kind of memory manipulation with APIs, and not doing it correctly. That could also easily blow up your memory.
------------
Regarding LAA, I'm not a fan. I know that a couple of people here use it, but any piece of code (your memory pointer code, third-party OCXs or DLLs) that don't correctly handle memory pointers, could hard-crash your program with LAA.
The "shuttle code to ActiveX DLLs" is a good idea, but, if you do that, you need to make sure there are chunks of code that you can load, and then unload when done, for that to be useful. If all of your code needs to be in memory at the same time, then ActiveX DLLs will actually be a hindrance.
------------
p.s. My primary application is also 100s of 1000s of lines of code, and I've got no memory problems at all. However, for the primary data storage, I use an MDB database, and the DAO to manipulate it. I'll occasionally have 20 or more tables open, but seldom will I actually read much data into memory. During various processing, I might read large ASCII files into memory in their entirety, but an ASCII file would have to be really large to make much of a dent on 2GB.
Just as a further FYI, on a 64-bit Windows machine (which most everything is these days) with any decent amount of memory in it (say, 8GB or more), we do get a full 2GB of memory for our VB6 program.
Last edited by Elroy; Feb 3rd, 2024 at 09:09 AM.
Any software I post in these forums written by me is provided "AS IS" without warranty of any kind, expressed or implied, and permission is hereby granted, free of charge and without restriction, to any person obtaining a copy. To all, peace and happiness.
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|