Results 1 to 5 of 5

Thread: Memory

  1. #1

    Thread Starter
    New Member
    Join Date
    Jun 2004
    Posts
    10

    Memory

    Hi all,

    I created a new windows application and on the default form, add one button.

    Thats it, now I compile the "application" in "release" mode and close visual studio.

    It creates the .exe of size = 10KB

    now when i run this application which is going to display me just a form with one button and absolutely no code, takes some - 8564K memory (Task Manager - processes tab - Mem usage)

    When this form is minimized - Mem usage becomes 696 KB
    and when again its restored then the Mem usuage is - 2284 K

    Will someone tell me why just a simple form takes so much memory and if possible how can we "reduce" this memory usuage to the mimimum possible?

    Thanks

  2. #2
    Frenzied Member Asgorath's Avatar
    Join Date
    Sep 2004
    Location
    Saturn
    Posts
    2,036

    Re: Memory

    Hi
    Don't worry its perfectly normal that's the size frameworks dlls loaded into memory.

    Since its a long time to create objects in memory garbagge collection keeps them in memory for awhile ...

    Regards
    Jorge
    "The dark side clouds everything. Impossible to see the future is."

  3. #3

    Thread Starter
    New Member
    Join Date
    Jun 2004
    Posts
    10

    Re: Memory

    Thank you both of you for your replies.

    I have 512MB Ram in my machine.


    But I am not really concerned about how much memory it takes on MY machine. I just want to optimise my programs so that .NEt applications utilise the minimum possible memory on a clients machine.


    Though it might appear negligible, what i am concerned is hows that, I see some programs running take hardly some 1500K (or say microsoft's agent server - that little cartoon thing in MsWord- takes just 700k) even with a very good user interface. Can we do something to reduce the memory usuage and kind of optimise our programs.

    Thank you

  4. #4
    Fanatic Member Graff's Avatar
    Join Date
    Jan 2002
    Location
    Calgary
    Posts
    668

    Re: Memory

    You might want to read this:

    http://west-wind.com/weblog/posts/240.aspx
    If wishes were fishes we'd all cast nets.

  5. #5
    Frenzied Member ntg's Avatar
    Join Date
    Sep 2004
    Posts
    1,449

    Re: Memory

    Quote Originally Posted by Graff
    You might want to read this:

    http://west-wind.com/weblog/posts/240.aspx
    Ehm...what that article says is a bit of crap if you ask me. On your task manager select the VM Size and if you do the same thing with a .Net app you'll see that it doesn't become affected as much as the memory usage. Minimizing really swaps out the process on guest operating systems (Win2K Pro, WinXP), I don't know what happens in server OSes. That trick doesn't do anything to reduce the actual memory requirements - instead it forces the OS to read your app from VM when it's restored from the tray, something that causes page faults (check that with task manager too) and that causes system I/O overhead.

    Quote Originally Posted by mateen
    Though it might appear negligible, what i am concerned is hows that, I see some programs running take hardly some 1500K (or say microsoft's agent server - that little cartoon thing in MsWord- takes just 700k) even with a very good user interface. Can we do something to reduce the memory usuage and kind of optimise our programs.
    Well, welcome to the world of VM environments (.Net & Java). 2Mb seems to be a quite reasonable memory requirement for .Net apps if you consider what gets loaded (core libs and other stuff you use like forms, xml etc. are quite large assemblies). If a small memory footprint and speed is critical, you should consider a language closer to the OS level (like C++) and a good optimizing compiler that takes advantage of the complete CPU instruction set.

    Cheers,
    NTG
    Last edited by ntg; Jan 16th, 2005 at 07:03 PM.
    "Feel the force...read the source..."
    Utilities: POPFileDebugViewProcess ExplorerWiresharkKeePassUltraVNCPic2Ascii
    .Net tools & open source: DotNetNukelog4NetCLRProfiler
    My open source projects: Thales SimulatorEFT CalculatorSystem Info ReporterVSS2SVNIBAN Functions
    Customer quote: "If the server has a RAID array, why should we bother with backups?"
    Programmer quote: "I never comment my code. Something that is hard to write should be impossible to comprehend."
    Ignorant quote: "I have no respect for universities, as they teach not practicle stuff, and charge money for"

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