Results 1 to 14 of 14

Thread: kedaman is this true

  1. #1
    Guest

    Unhappy

    Just got an email from our local experts circle and they claim that....a cls file once activated in a vb project remains in memory for the duration of that project.....

    May be this could be the answer to a number of posts regarding memory usage? Don't know, our memory problems are generally to do with the number of dlls attached to a project.

    Am so confused on this issue

  2. #2
    transcendental analytic kedaman's Avatar
    Join Date
    Mar 2000
    Location
    0x002F2EA8
    Posts
    7,221
    Hehe, dunno, how could i know about something that really never ocurred to me.
    Sounds reasonable anyway, why would the app unload the class in the middle if there could be a chance it has to use it again I'm not sure either about this but i think all classes are loaded at execution, if in the same project, and i think in that case doesn't count Dll's
    Use
    writing software in C++ is like driving rivets into steel beam with a toothpick.
    writing haskell makes your life easier:
    reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
    To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.

  3. #3
    Guest

    Angry Damn that could explain some things

    Vaguely remember that you were one of the people who asked about "out of memory" errors. Thought this may be an answer. We currently have a guy expiermenting with this issue to see if what is claimed is true.

    Bad design by MS if it is the case, if a class file is only used on one form or by one bas through a project, why load it at execution, the form/bas may not be called during the current session.

    Hopefully a worst case is that it gets left in memory after accessing, and can be set to nothing after use. Knowing MS as we do this is quite likely not to be the case. Could be yet another arguement for switching to Delphi.

  4. #4
    transcendental analytic kedaman's Avatar
    Join Date
    Mar 2000
    Location
    0x002F2EA8
    Posts
    7,221
    Hmm, i don't even remember this myself, maybe there's out of memory in my brain hehe. But actually i think that's what the problem is, why would all the classes be accessible in designtime anyway? If they weren't loaded then why can you use any of them whenever you want by using immediate window for instance.

    I think i mixed up one thing in my last post if anyone didn't notice, i meant that the standard Dll's don't get loaded at startup while ActiveX's should probably be there loaded all the time until the app terminates.

    Use
    writing software in C++ is like driving rivets into steel beam with a toothpick.
    writing haskell makes your life easier:
    reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
    To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.

  5. #5
    Addicted Member
    Join Date
    Jun 2000
    Posts
    175

    Fro what ist worth

    Hi,
    I don't know if it of any use but, once I used Microsoft forms 2.0 object library in my project and for a listbox whict accepts mor than 32767 items.

    It worked fine at the runtime but when it was compiled I kept getting out of memory error even, when I put nothing in the listbox. When I removed the said library my program worked fine.

    Mass

  6. #6
    New Member
    Join Date
    Aug 2000
    Posts
    15
    Surely the app only needs one instance of the class in memory so that it knows data structures etc.

    When you create an instance of that class..it reserves memory

    When you set the class variable to nothing it frees up??

  7. #7
    Guest

    Angry This is a truely weird feature

    Latest reports from the trenches is that when the project fires up no classes are put in memory....apparently we are still trying to verify this.....but when you access a form with classes on it, they are immediatly put into memory, and stay active during the life of the exe. Apparently setting them to nothing issues an error, Phantomd is going to test this out today as LA may have coded it wrong.

    Gee another great feature from Microsoft, up there with Mass's library issue.

  8. #8
    transcendental analytic kedaman's Avatar
    Join Date
    Mar 2000
    Location
    0x002F2EA8
    Posts
    7,221
    That sounds really weird! Jethro i'm not sure what you mean, by "Apparently setting them to nothing issues an error"
    Use
    writing software in C++ is like driving rivets into steel beam with a toothpick.
    writing haskell makes your life easier:
    reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
    To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.

  9. #9
    Guest

    Haven't been in the office in a couple of weeks but

    Code:
    Set clsCustomer = Nothing.
    Is setting off an error, may have mistyped that, anyway Phantomd is going to swing by and check it out. For all we know LA Dave forgot to add the friggin class in the first place.

  10. #10
    transcendental analytic kedaman's Avatar
    Join Date
    Mar 2000
    Location
    0x002F2EA8
    Posts
    7,221
    Hey Jethro, that's the way you remove Objects from memory, not classes
    Use
    writing software in C++ is like driving rivets into steel beam with a toothpick.
    writing haskell makes your life easier:
    reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
    To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.

  11. #11
    Guest

    Question Ahhhhh.....how do you clear a cls file then

    Sorry have been away getting my mind around "frocking up for the melbourne cup" and getting a delivery docket to work on a pos printer....the joys of professional programming.

  12. #12
    transcendental analytic kedaman's Avatar
    Join Date
    Mar 2000
    Location
    0x002F2EA8
    Posts
    7,221
    Can't think of anything, i'm almost sure it's impossible
    Use
    writing software in C++ is like driving rivets into steel beam with a toothpick.
    writing haskell makes your life easier:
    reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
    To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.

  13. #13
    Guest
    In design time,the classes are not loaded. The intellisense stuff works by looking at the code physically, or though a typelib interface it avaialble.

    At runtime, certain types of referecned classes are loaded immediately (publicnotcreatable for instance), and other classes are loaded when required. Only one copy of the classis is ever in memery at once (or so the theory goes). Many instances just have a bit of memory reserved for them to store their particular variables values.

    Code:
    Set mobjMyClass = Nothing
    should work all the time. You have got a dot at the end, but that's probably a typo.

    - gaffa


  14. #14
    Guest

    Angry Ok the expiermenting continues

    Kedaman your right setting to nothing causes an execution error everytime. Classes are being loaded as they are accessed, but are never unloaded during the projects lifetime. BAS files seem to be the answer to these, but then they aren't really class files as such.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width