Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

SP6 - IDE just exiting when running a project

Status
Not open for further replies.

robdon

Programmer
May 21, 2001
252
ES
Hi,

Just upgraded from SP5 -> SP6 and having some problems.

Randomly, while running my app in debug through the IDE, VB shutsdown completly with no error messages.

I get nothing, it just exits.

It seems to be in random spots, but its hard to find where it is, because it just exists :(

Anyone had this?? Or know why the IDE would just exit for no reason??

Thanks,

Rob D
 
Hi,

Think I've narrowed it down to a single proc.

I have a proc with the following in it...

Static dicP As New Dictionary

This proc is called very often.

Not too sure about this, but...

Is that going to create a 'new' instance of dirP each time the routine is called, therefore, it will consume lots of memory and eventually fall over???

I had presumed, that it would only create a new one on the first call, and then use that on subsequent calls??

If so, is it not possible to use Static and Dictionaries??


Thanks,

Rob D.
 
Variables local to a procedure are always allocated when the procedure is run. While they should also be deallocated at the end of the procedure, have you tried:

SET dirP = Nothing

at the end of your procedure? This should insure the memory is deallocated.

 
Hi,

I've declared the var as 'static' so it would not get deallocated at the end of the procedure... correct??

Rob D.
 
Hi Rob:

Suggestion, if I may:

Declare the variable as static:
Code:
    Static dirP as Dictionary
then assigned it in the code:
Code:
    If dirP is Nothing Then set dirP = New Dictionary

This way, the variable is not de-allocated at the end of the procedure and is not re-allocated each time you enter the procedure.

HTH,
Cassandra
 
Hi,

Thanks for the suggestions...

I've found the problem now.

I had missed using the .RemoveItem to remove entries that I no longer needed, therefor the 'Dictionary' just kept getting bigger & bigger. Eventaully when it ran out of space (some 300,000 items later) it killed VB & my app.

Now I've got my .RemoveItem in the correct place all is fine.

Still, it would have been nice to have got a 'Out Of Memory' message, instead of VB just exiting :(

Thanks,

Rob D.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top