Results 1 to 8 of 8

Thread: Creating apps with smaller memory load

  1. #1

    Thread Starter
    Hyperactive Member cajsoft's Avatar
    Join Date
    Aug 2000
    Location
    Glasgow, Scotland
    Posts
    295

    Angry

    Hi,
    I've just created a small app in VB 6.0, it's file size is 24KB. There are no extra components added to the application, but when I run the app and check task manager (win2000) it says the the app is using 1896K in memory and 548K in Virual memory... Surely this cant be correct. The program has only 1 form with 1 label and 1 picture box and about 20 lines of code (very small)

    Is there any way I can reduce the overhead with VB?

    Regards,
    Craig.

  2. #2
    Frenzied Member Jop's Avatar
    Join Date
    Mar 2000
    Location
    Amsterdam, the Netherlands
    Posts
    1,986
    I think the VB runtimes make tha app a lot bigger, and what's your app doing? You have a lot of variables?
    Jop - validweb.nl

    Alcohol doesn't solve any problems, but then again, neither does milk.

  3. #3

    Thread Starter
    Hyperactive Member cajsoft's Avatar
    Join Date
    Aug 2000
    Location
    Glasgow, Scotland
    Posts
    295
    Its a small utility that shows actual physical memory used.
    It contains about 30 variables.

    It also contains the code below, do you think this might be making it alot larger?

    Code:
    Private Declare Sub GlobalMemoryStatus Lib "kernel32" (lpBuffer As MEMORYSTATUS)

    Craig.

  4. #4
    Fanatic Member
    Join Date
    Feb 2000
    Location
    The Netherlands
    Posts
    715
    I think the picture box takes a lot of memory. Try to save the contents of it to a .bmp file and check the size.
    Oetje
    [email protected]
    93606776
    Visual Basic 6, Windows 2000

    Never pet a burning dog

  5. #5

    Thread Starter
    Hyperactive Member cajsoft's Avatar
    Join Date
    Aug 2000
    Location
    Glasgow, Scotland
    Posts
    295
    The picture box contains no image, only a line this is created with

    Code:
    Picture1.Line (0, 0)-((Picture1.ScaleWidth / 100 )), blah
    I mean it's only 26K in size on the disk!

    Craig.

  6. #6
    Fanatic Member
    Join Date
    Feb 2000
    Location
    The Netherlands
    Posts
    715
    How big is the picture box?
    Oetje
    [email protected]
    93606776
    Visual Basic 6, Windows 2000

    Never pet a burning dog

  7. #7
    Frenzied Member Vlatko's Avatar
    Join Date
    Aug 2000
    Location
    Skopje, Macedonia
    Posts
    1,409
    The app written in VB will always take at least 1800Kb of mem.The MSVBVMx0.DLL is 1300 KB.Then every app uses the Kernel32.dll and every active x control takes up more mem because more dlls are loaded.
    VB is not really a language that has some memory control.If you want your app to take less mem use C++.
    I am become death, the destroyer of worlds.
    mail:[email protected]

    • Visual Basic 6.0 & .NET
    • Visual C++ 6.0 & .NET
    • ASP
    • LISP
    • PROLOG
    • C
    • Pascal

  8. #8

    Thread Starter
    Hyperactive Member cajsoft's Avatar
    Join Date
    Aug 2000
    Location
    Glasgow, Scotland
    Posts
    295
    Thanks for the reponses guys. I understand now why the memory load is so high.. It's funny when you look through task manager, and see that all the other microsoft bits and bobs that are running in memory are all considerably smaller in load than my 26k program.. I'm not suprised why most developers keep away from VB, even microsoft!!

    Cheers
    Craig.

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