Class module memory leak?

D

Dave Unger

Hello,

Running XL2007 on Windows XP
..
I’m currently working on a large project, where it’s starting to look
like making use of class modules would be the way to go. This is my
first “serious” venture into the world of class modules, so at this
point things are quite simple – in fact, so far all my code is copied,
more or less verbatim, from samples in Bullen-Bovey-Green’s
“Professional Excel Development” book.

Here’s the problem I’m running into. During development, there are
the usual stops and breaks to do a bit of tweaking/fixing. Then, at
some point I start getting “out of stack space” & “not enough
resource” messages, and even the VBE seems to get a bit befuddled.
However, if I shut down Excel and then re-open the application,
everything appears to work fine and Excel’s memory remains stable.

I don’t really know what I’m talking about here, but it seems to me
that the stops and breaks are leaving behind bits of class objects,
and Excel isn’t reclaiming that memory during the current session.
I’m just wondering if this is considered normal when working with
class modules.

I’d appreciate anyone’s comments on this. Thank you.

Regards,

Dave U
 
J

JLGWhiz

The best that I can tell you is that Stack Overflow and Out of Memory
messages usually indicate some poorly written code. Infinite loops, self
perpetuating event code, etc. can all cause these kinds of messages. There
are some discussions on then on the web if you search for them.



Hello,

Running XL2007 on Windows XP
..
I’m currently working on a large project, where it’s starting to look
like making use of class modules would be the way to go. This is my
first “serious” venture into the world of class modules, so at this
point things are quite simple – in fact, so far all my code is copied,
more or less verbatim, from samples in Bullen-Bovey-Green’s
“Professional Excel Development” book.

Here’s the problem I’m running into. During development, there are
the usual stops and breaks to do a bit of tweaking/fixing. Then, at
some point I start getting “out of stack space” & “not enough
resource” messages, and even the VBE seems to get a bit befuddled.
However, if I shut down Excel and then re-open the application,
everything appears to work fine and Excel’s memory remains stable.

I don’t really know what I’m talking about here, but it seems to me
that the stops and breaks are leaving behind bits of class objects,
and Excel isn’t reclaiming that memory during the current session.
I’m just wondering if this is considered normal when working with
class modules.

I’d appreciate anyone’s comments on this. Thank you.

Regards,

Dave U
 
D

Dave Unger

Hello JLGWhiz

Thanks for your reply.
The best that I can tell you is that Stack Overflow and Out of Memory
messages usually indicate some poorly written code.  Infinite loops, self
perpetuating event code, etc. can all cause these kinds of messages.  There
are some discussions on then on the web if you search for them.

You're absolutely right, and I'm embarrased! Before posting this, the
application did seem to be operating OK when run "normally". However,
right after posting this, I fired it up again, and immediately got an
"out of stack space" message. This had not happened before (and I've
been working on this for a few days).

Sure enough, it was stuck in a loop - a typo in a property Let
statement was constantly updating the property instead of the
variable, I'm sorry to have troubled you about this, my only (poor)
excuse for not picking up on this right away is my lack of experience
working with class modules,

Again, thanks so much for your reply,

Dave U
 
J

JLGWhiz

Don't be embarrassed or apologetic. We all do it once in a while. The
important thing is that you found the problem. Happy I could help.



Hello JLGWhiz

Thanks for your reply.
The best that I can tell you is that Stack Overflow and Out of Memory
messages usually indicate some poorly written code. Infinite loops, self
perpetuating event code, etc. can all cause these kinds of messages. There
are some discussions on then on the web if you search for them.

You're absolutely right, and I'm embarrased! Before posting this, the
application did seem to be operating OK when run "normally". However,
right after posting this, I fired it up again, and immediately got an
"out of stack space" message. This had not happened before (and I've
been working on this for a few days).

Sure enough, it was stuck in a loop - a typo in a property Let
statement was constantly updating the property instead of the
variable, I'm sorry to have troubled you about this, my only (poor)
excuse for not picking up on this right away is my lack of experience
working with class modules,

Again, thanks so much for your reply,

Dave U
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top