Results 1 to 2 of 2

Thread: How much Memory is being used?

  1. #1

    Thread Starter
    Member MorkenTheMonk's Avatar
    Join Date
    Sep 2017
    Location
    Scotland, UK
    Posts
    42

    How much Memory is being used?

    Hey gurus,

    Inherited a sizeable 16-bit VB3 application that's been resurrected and migrated across to VB6, with further development taking place to introduce new features. All going well (so far).

    My question is, are there any tools / techniques available to interrogate how much memory is being used by the application? Specifically, I'd like to know how much memory the numerous Global arrays/variables are using, and whether the memory being used by Global or Local arrays/variables is being freed up when ReDim() or Procedures are exited.

    I can use Task Manager to look at my VB6 compiled application Process, and this shows me the amount of Memory (Private Working Set). Currently sitting around 18,000K which doesn't seem too bad at all.

    I've also installed Process Monitor from SysInternals, and filtered output to show only my VB6 application, however I'm too much of a novice to be able to interpret the output (!?)

    No issues yet with memory on 64-bit Windows 7 / 10 machines, however I'd like the comfort of knowing we're not heading for a limit in the near future.

    Thanks for any advice you can give.
    Last edited by MorkenTheMonk; Jul 3rd, 2019 at 04:25 AM.
    __________________________________________________________________________________________
    MorkenTheMonk
    SCOTLAND

    (Stuck supporting a 16-bit VB3 application over 20 years old! Deep Joy!!!)

  2. #2
    VB-aholic & Lovin' It LaVolpe's Avatar
    Join Date
    Oct 2007
    Location
    Beside Waldo
    Posts
    19,541

    Re: How much Memory is being used?

    Quote Originally Posted by MorkenTheMonk View Post
    Specifically, I'd like to know how much memory the numerous Global arrays/variables are using, and whether the memory being used by Global or Local arrays/variables is being freed up when ReDim() or Procedures are exited.
    The following is an oversimplification

    If this project was created for operating systems when VB3 was king, gotta think you won't have any issues on modern O/S. If that app was used for years back then without customers complaining about "out of memory" errors, you may be worrying about nothing.

    All globals use some memory, if not just for the VarPtr. Global variables (non-arrays/objects) use constant memory, since they have default values. Arrays use additional memory if they contain data. Similar are objects if they are not set to Nothing. Variants, I think, are a constant 16 bytes minimum. ReDim will either increase the size of the allocation or deallocate & reallocate. Anything local to a procedure is released when the procedure exits. This question has everything to do with scope.

    For each array item, it uses x nr of bytes (1,2,4,8, etc). Knowing how many are being used is simple math: total number of elements across all array dimensions multiplied by the byte count of each element. If the array is non-numeric (string, objects, for example), then it gets more complex because each array item is a 4-byte pointer to other data. Other forms of data aren't discussed but exist, i.e., collections
    Last edited by LaVolpe; Jul 3rd, 2019 at 12:11 PM.
    Insomnia is just a byproduct of, "It can't be done"

    Classics Enthusiast? Here's my 1969 Mustang Mach I Fastback. Her sister '67 Coupe has been adopted

    Newbie? Novice? Bored? Spend a few minutes browsing the FAQ section of the forum.
    Read the HitchHiker's Guide to Getting Help on the Forums.
    Here is the list of TAGs you can use to format your posts
    Here are VB6 Help Files online


    {Alpha Image Control} {Memory Leak FAQ} {Unicode Open/Save Dialog} {Resource Image Viewer/Extractor}
    {VB and DPI Tutorial} {Manifest Creator} {UserControl Button Template} {stdPicture Render Usage}

Tags for this Thread

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