Results 1 to 8 of 8

Thread: VB and Memory!!!

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Sep 2001
    Location
    Orlando
    Posts
    392

    Red face VB and Memory!!!

    Hi guys,
    Back here after a long time. Have been really busy.

    Lets get straight to the point.
    Recently I developed a Point of Sale Application which would be used on various Windows OS.

    One of the locations that uses Win 98 on an AMD K6 machine with 32MB RAM, has been complaining about the software getting stuck without any message right when they try to close a sale.
    It happens occassionally and not for any specific reason.

    After a lot of trying, I could figure out that the system is running low in resource and that somehow causing the machine to hang.

    Its a simple application that starts with about 7MB of Memory.

    I was trying to find how much Memory it takes when the Forms are opened and closed. Surprisingly, every single action causes the Application to use more memory, and when the Forms are closed, the memory is not completely released by the Application. So by the time I made two sales and did some more stuff with the Application, it was using more than 13MB of Memory!

    Yes, I took every caution to release objects I created in the Application. Recordsets are implcitly closed before they are destroyed and so on. Its an object oriented design and everything is done through interactions of objects.

    I can replace the old systems with more memories, but...

    What do you think guys?
    Abu Haider
    ____________________________
    100% Data Validation for the MS DataGrid Control. Plus Support for Custom and Foreign Lists, DatePicker and much more...
    The DataGridEnhancer


    I often point to a place where the problem has been discussed, instead of giving you the code that solves it. This is for good, may be you will understand some day...

  2. #2
    I wonder how many charact
    Join Date
    Feb 2001
    Location
    Savage, MN, USA
    Posts
    3,704
    Hmmm.... this is good stuff....; I like this stuff.....

    What components are using on the forms...
    and how are you unloading the forms.....
    I assume you are of course using Set Form1=Nothing

    but it does make a difference when u do it...

    You might have to post some more information on this...

    Could you attach the executable?

  3. #3

    Thread Starter
    Hyperactive Member
    Join Date
    Sep 2001
    Location
    Orlando
    Posts
    392
    Janus GridEx 2000 is extensively used on all forms, and if you don't own a copy of it, I guess you won't be able to run the Application, and also needed the database with it.

    Other than that third party control, I guess I occassionally used one or two of my own custom controls, but they are very lightweight. And the rest is just basic controls.

    No, I didn't set the forms explicitly to nothing, because they are reused and I didn't want it to initialize itself everytime they are used. And an average of 3 to 4 Form level variables are used. Most Forms create or obtain an object and request it to perform the action. Only interface functionality, like control navigation resizing etc and basic data validation is performed on the Forms.

    I can see the terminate events firing whenever they are expected to fire.

    The Application uses only one Database connection, and the connection is shared at the application level by all objects and forms that require Database access.

    What do you think?
    Abu Haider
    ____________________________
    100% Data Validation for the MS DataGrid Control. Plus Support for Custom and Foreign Lists, DatePicker and much more...
    The DataGridEnhancer


    I often point to a place where the problem has been discussed, instead of giving you the code that solves it. This is for good, may be you will understand some day...

  4. #4
    I wonder how many charact
    Join Date
    Feb 2001
    Location
    Savage, MN, USA
    Posts
    3,704
    Other than that third party control, I guess I occassionally used one or two of my own custom controls, but they are very lightweight. And the rest is just basic controls.
    So basically, even if these user controls were not shut down properly, they wouldn't account for the sudden jump in memory usage.
    Janus GridEx 2000 is extensively used on all forms
    Suspect....

    No, I didn't set the forms explicitly to nothing, because they are reused and I didn't want it to initialize itself everytime they are used.
    Try setting them to nothing just for debugging purposes and see if that makes a difference. It could also help determine if the third-party control is being instatiated too many times....

    And an average of 3 to 4 Form level variables are used. Most Forms create or obtain an object and request it to perform the action. Only interface functionality, like control navigation resizing etc and basic data validation is performed on the Forms.
    Basically then, not a reasonable cause of the sudden jump in memory.

    The Application uses only one Database connection, and the connection is shared at the application level by all objects and forms that require Database access.
    Doesn't sound like a problem either...

  5. #5

    Thread Starter
    Hyperactive Member
    Join Date
    Sep 2001
    Location
    Orlando
    Posts
    392

    Thanks a lot

    I will get to the Bottom of it.

    Will conduct an extensive research to find out if the problem actually lies in VB, or in Janus GridEx.

    Will soon employ somebody from the group for it.

    And will try to keep this thread updated.
    Abu Haider
    ____________________________
    100% Data Validation for the MS DataGrid Control. Plus Support for Custom and Foreign Lists, DatePicker and much more...
    The DataGridEnhancer


    I often point to a place where the problem has been discussed, instead of giving you the code that solves it. This is for good, may be you will understand some day...

  6. #6

    Thread Starter
    Hyperactive Member
    Join Date
    Sep 2001
    Location
    Orlando
    Posts
    392

    Post Update

    Setting the Forms explicitly to nothing didn't help!
    Is it that Janus GridEx is alocating memory which is not released upon termination of the control?
    Abu Haider
    ____________________________
    100% Data Validation for the MS DataGrid Control. Plus Support for Custom and Foreign Lists, DatePicker and much more...
    The DataGridEnhancer


    I often point to a place where the problem has been discussed, instead of giving you the code that solves it. This is for good, may be you will understand some day...

  7. #7
    ^:^...ANGEL...^:^ wrack's Avatar
    Join Date
    Mar 2002
    Location
    Melbourne, AUSTRALIA
    Posts
    2,695

    Thumbs up hmmm...

    My app starts with 2.5 MB and after surfing around all the forms when I come back to MAIN FORM in the taskmanager it shows 72.5 MB...

    I think you are lucky then me...

    I figured out that if I redesign the database which wasn't made by me before then it will consume half...this is a hint...

    Is your database completely normalized...??? sometimes you need to denormalized some tables to improve performace...

    Cheers...

  8. #8

    Thread Starter
    Hyperactive Member
    Join Date
    Sep 2001
    Location
    Orlando
    Posts
    392

    Good Point

    Right after learning about normalization tids and bits, I tried to completely normalize every one of databases that I designed.
    Resulting in a lot of Joins and Processing in my Application.

    That was a long time ago. Disk space is not an issue anymore. And I don't mind avoiding those complex joins and processing times by sacrifycing a bit of Disk Space. In turns, it also saves me a lot of time.

    No, the Database is not completely normalized.
    Abu Haider
    ____________________________
    100% Data Validation for the MS DataGrid Control. Plus Support for Custom and Foreign Lists, DatePicker and much more...
    The DataGridEnhancer


    I often point to a place where the problem has been discussed, instead of giving you the code that solves it. This is for good, may be you will understand some day...

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