• 0

Why does VB apps use so much memory?


Question

16 answers to this question

Recommended Posts

  • 0

The answer to query lies in the fact that VB6 is an interpreted language whereas what you're expecing is a compiled language. (If you need to know the difference, then Google it).

VB6 is generally regarded as a memory hog compared to solutions for same problems when comapred to C or C++ programs.

Parimal

  • 0

I write all my software using VB6, and it's most likely that it's because the VB6 runtimes are attached to each program you write. This is why there's an extra 3MB or so to your app. But like hash said, memory is cheap these days, and who cares if it's 3mb or 500kb.

  • 0
  parimal_kumar said:
The answer to query lies in the fact that VB6 is an interpreted language whereas what you're expecing is a compiled language. (If you need to know the difference, then Google it).

VB6 is generally regarded as a memory hog compared to solutions for same problems when comapred to C or C++ programs.

Parimal

I thought that VB6 was a compiled language. :huh: :unsure:

  • 0

Change the compiler mode... "P-Code" and "Native Code", I don't remember which one is default, try both.

Programs programmed in assembly language uses the smallest amount of memory, Windows allocates memory for the program and if the program needs more then the program must call external functions that the assembler doesn't put there itself.

  • 0
  parimal_kumar said:
Nope! VB 6 is most definitely interpreted. That's why it's deemed slower than its compiled counterparts such as VC++

Parimal

Wrong. VB 6 defaults to compiling to a native binary. You have to go in and change the setting to get PCode. It's been that way since VB 5.

  • 0

It still heavily depends on several system libraries, such as MSVBVM*0.DLL or something like that.

You can see the list of exports that DLL provides, and it doesn't matter wich way you compiled your program (p-code or native), it still requires many many many functions from it.

  • 0

Yes, vb6 is compiled. No, the runtimes are not included in the exe. The reason for high memory usage is similar to why .net uses so much; if your system begins to run out of ram, less is allocated to the vb6 app. If it really bothers you, use the SetProcessWorkingSetSize API and lower the mem usage that way.

  • 0
  Latka said:
It still heavily depends on several system libraries, such as MSVBVM*0.DLL or something like that.

You can see the list of exports that DLL provides, and it doesn't matter wich way you compiled your program (p-code or native), it still requires many many many functions from it.

VC++ has its own libraries as well, such as msvcrt.dll.. so comparing required runtimes to memory usage doesnt really work

  • 0
  hash said:
VC++ has its own libraries as well, such as msvcrt.dll.. so comparing required runtimes to memory usage doesnt really work

Well no, you can't "compare" the memory requirement to the runtime, because the VC runtime libraries don't do the same things that the VB runtimes do; they're really not even the same thing. The VC runtimes are Win32 DLLs that a VC++ application calls to get work done; the VB runtimes are COM libraries.

That's actually the source of the extra memory requirement (to answer the original question). VB programs aren't actually programs by themselves; they rely on COM.

  • 0

ok....heres the DEFINITIVE answer to ur question:

like everyone else so far has told you, yes VB6 DOES require certain runtime files. These runtime files are loaded in the memory even before YOUR app starts, and even before your first line of code is executed, or your first form pops up. When you goto the VB6 package and deployment wizard it includeds these runtime files in your distribution, so that when you give your program to your friends, who might not have these runtime files, it will install them on their PC.

is this really bad? well, yes and no. from a purely technical standpoint, this tells you that yeh, VB6 is inefficient compared to other languages like C++ or C. It imposes a significant overhead (roughly 2-3 MB), which might make your small apps, and nifty tools that you program in VB seem quite ugly, compared to what they could have been if made in VC++.

However from a more realistic viewpoint, it hardly matters. Firstly because like everyone said, 2-3 MB in todays world is hardly a problem. With systems having 512+ MB, im sure everyone can spare a little extra. Secondly, this overhead of 2-3 MB remains constant no matter how large YOUR application is. So wheather you make a 1 form app, or a MONSTER containing 200 forms, and a couple of thousand lines of code, the EXTRA amount taken will remain 2-3 MB for the dll files, and you will notice that the memory occupied doesn't increase so sharply as the size of your app grows.

Hope this helps

danish

This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.
  • Posts

    • XMedia Recode 3.6.1.3 by Razvan Serea XMedia Recode is a free video and audio converter. XMedia Recode supports nearly all audio and video codecs. With XMedia Recode you can easily convert nearly all film and music files in the format you want. Convert for countless devices, select the predefined profile (iPhone, iPad, iPod Touch, Android-Tablets, Sony PSP, Amazon Kindle, Smartphones Blackberry, Wii und DS, Cowon, Android, HTC, Xbox360, Samsung, LG). XMedia Recode converts: 3GP in AVI, 3GP in FLV, AC3 in MP3, AC3 in WAV, ASF in 3GP, ASF in FLV, ASF in MP4, AVI in FLV, AVI in 3GP, FLAC in MP3, FLAC in WMA, FLV in 3GP, FLV in Mp3, DVD in 3GP, DVD in AC3, DVD in AVI, DVD in MP3, DVD in MP4, DVD in MOV, DVD in SVCD, DVD in VCD, DVD in WMV, OGG in MP3, OGG in WMA, MPEG in AVI, MP2 in MP3, MP4 in FLV, MP4 in AVI, M4P in MP3, MOV in 3GP, MOV in AVI, MOV in FLV, WMA in MP3, WMV in FLV, WAV in MP3. Main functions of XMedia Recode: Extracts audio tracks from DVD, Blu-ray and video files Framework also freely selectable color (Padding) Drag-n-drop of video files directly on the encoder Selection display format (1: 1, 3:2, 4:3, 5:4, 5:6, 11:9,16: 9, 16:10, 2.21: 1) Zoom shot (none, type character box, media, Pan Scan, to screen) ''Direct Stream'' copies the audio stream or video stream into the target format 2-Pass-Encoding Volume correction Can change framerate, bit rate, resolution Can extract audio stream of most video formats Produce DVD copies for mobile phones, various mobile devices Edit Video: Color correction Video cut Cropping Denoise Delogo Deblocking De-interlacing Flip Image Start Time End Time Resolution Rotate Image Sepia Sharpness Padding Video fade in / fade out XMedia Recode 3.6.1.3 changelog: Update of ffmpeg AOM AV1 Codec: Added "Quantization" options Update of x264 (3221) Codec Update of the Italian language file Update of the Korean language file Fixed minor bugs Download: XMedia Recode 64-bit | Portable ~20.0 MB (Freeware) Download: XMedia Recode 32-bit | Portable Download: XMedia Recode for Windows XP SP3, Vista | Portable ~10.0 MB View: XMedia Recode Website | Screenshot Get alerted to all of our Software updates on Twitter at @NeowinSoftware
    • It's not a joke but I think it is pretty hilarious I was searching Fitch for a credit rating on a fund.   I found what Fitch had to say about the fund including this disclarimer.  LOL "This abstract may have been generated in whole or in part using artificial intelligence and is therefore subject to error and inaccuracy, including but not limited to, hallucination" No link posted for privacy reasons.       
    • Save up to 83% on a lifetime subscription to 1minAI (choose from three plans) by Steven Parker Today's highlighted deal comes via our Apps + Software section of the Neowin Deals store, where for only a limited time, you can save up to 83% on lifetime subscriptions to 1minAI. Whether you're a copywriter, designer, social media manager, podcaster, small business owner, or just someone who needs AI for different uses, 1minAI is for you. Powered by various AI models, 1minAI offers a diverse range of AI features that can surely help you with whatever you need. Chat with numerous assistants, create images, write blog posts, optimize your website, and much more with ease. Plus, it’s always improving with weekly updates that you'll get through the 1minAI Newsletter and Public Roadmap. Powered by various AI models Chat with many assistants Chat with AI for smart and interactive conversations. Get help with all sorts of questions and tasks, making problem-solving and decision-making super easy. Chat with: GPT-4o, GPT-4 Turbo, GPT-4, GPT-3.5 (OpenAI) Claude 3 Opus, Claude 3 Sonnet, Claude 3 Haiku, Claude 2.1, Claude Instant 1.2 (Anthropic) Gemini Pro 1.5, Gemini Pro 1.0 (GoogleAI) Llama 3, Llama 2 (MetaAI) MistralAI Command (Cohere) Comprehensive writing tools Keyword Research Blog Article Generator Rewriter Content Expander Content Shortener Paraphraser Summarizer Grammar Checker LinkedIn Comment X (Twitter) Comment Facebook Comment Brand Voice Generator Advanced image processing and editing capabilities Image Generator Image to Prompt Image Variator Background Replacer Background Remover Text Remover Image Upscaler Search and Replace Image Editor Interact with PDF documents using various AI models Summarize the content of the PDF Translate the text within the PDF Answer questions based on the information in the PDF AI for audio & video editing Audio: Versatile audio editing and processing tools that help you edit, enhance, and manipulate audio files for various purposes. Text to Speech Speech to Text Audio Translator Video: Edit, enhance, and create videos with professional quality 1minAI Pro Plan Includes 4,000,000 credits/month plus the opportunity to generate up to 450,000 additional credits/month for free* All product features All AI features Flagship AI Models Unlimited prompt library Unlimited storage Unlimited brand voice Flexible credit use Monthly credits usage example Generate up to 1,112,500 words per month Research up to 5,933 SEO keywords per month Generate up to 1,186 images per month Upscale up to 741 images per month Remove background up to 74 images per month TTS up to 370,833 characters per month Transcribe audio up to 14,833 seconds per month Generate up to 37 videos per month 20 members Members Management Sharing - Collaboration Good to know Free 15,000 credits when logging in daily, equivalent to 450,000 credits/ month NOTE: Codes are NOT stackable. Length of access: lifetime Redemption deadline: redeem your code within 30 days of purchase Access options: web browser Updates included For example, a lifetime subscription to 1minAI (Business Plan) normally costs $540, but this deal can be yours for just $99.99, a savings of $440. For full terms, specifications, and license info please click the link below. Get the Business Plan lifetime deal for just $99.99, or learn more There are two other plans to choose from at the above link Although priced in U.S. dollars, this deal is available for digital purchase worldwide. We post these because we earn commission on each sale so as not to rely solely on advertising, which many of our readers block. It all helps toward paying staff reporters, servers and hosting costs. Other ways to support Neowin Whitelist Neowin by not blocking our ads Create a free member account to see fewer ads Make a donation to support our day to day running costs Subscribe to Neowin - for $14 a year, or $28 a year for an ad-free experience Disclosure: Neowin benefits from revenue of each sale made through our branded deals site powered by StackCommerce.
    • Be careful what you wish for. Microsoft’s ideas for bells and whistles either brings ads, web views, “AI stuff”, bugs, or all four. I’d be happy if it was just full of performance optimizations and bugfixes.
    • Still needs many more bricks to accurately model that pos. 
  • Recent Achievements

    • Dedicated
      Cole Multipass earned a badge
      Dedicated
    • Week One Done
      Alexander 001 earned a badge
      Week One Done
    • Week One Done
      icecreamconesleeves earned a badge
      Week One Done
    • One Year In
      PAC0 earned a badge
      One Year In
    • One Month Later
      PAC0 earned a badge
      One Month Later
  • Popular Contributors

    1. 1
      +primortal
      564
    2. 2
      +FloatingFatMan
      188
    3. 3
      ATLien_0
      184
    4. 4
      Skyfrog
      113
    5. 5
      Som
      109
  • Tell a friend

    Love Neowin? Tell a friend!