Results 1 to 11 of 11

Thread: Garbage Collector

  1. #1

    Thread Starter
    Fanatic Member
    Join Date
    Jan 2005
    Location
    In front of this pc.
    Posts
    580

    Garbage Collector

    Anyone have a good method for causing the window's garbage collector to run?

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

    Re: Garbage Collector

    I'm not sure there is such a thing. You can force a garbage collector run for your application by using System.GC.Collect().

    Cheers,
    NTG
    "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"

  3. #3
    I'm about to be a PowerPoster! kleinma's Avatar
    Join Date
    Nov 2001
    Location
    NJ - USA (Near NYC)
    Posts
    23,373

    Re: Garbage Collector

    Quote Originally Posted by ntg
    I'm not sure there is such a thing. You can force a garbage collector run for your application by using System.GC.Collect().

    Cheers,
    NTG
    lol isn't your solution doing what you said you weren't sure existed

  4. #4
    type Woss is new Grumpy; wossname's Avatar
    Join Date
    Aug 2002
    Location
    #!/bin/bash
    Posts
    5,682

    Re: Garbage Collector

    Existential!
    I don't live here any more.

  5. #5

    Thread Starter
    Fanatic Member
    Join Date
    Jan 2005
    Location
    In front of this pc.
    Posts
    580

    Re: Garbage Collector

    did I post this in the .Net forum or did it get moved?

    Anyway, guess maybe I shoulda specified that I was working in vb6.

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

    Re: Garbage Collector

    Quote Originally Posted by kleinma
    lol isn't your solution doing what you said you weren't sure existed
    I don't think there is a garbage collector for a window alone.
    "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"

  7. #7
    I'm about to be a PowerPoster! kleinma's Avatar
    Join Date
    Nov 2001
    Location
    NJ - USA (Near NYC)
    Posts
    23,373

    Re: Garbage Collector

    Quote Originally Posted by ntg
    I don't thing there is a garbage collector for a window alone.
    i took it as the window's garbage collector as in

    the Microsoft Windows garbage collector... (as in the CRL garbage collector)


  8. #8
    l33t! MrPolite's Avatar
    Join Date
    Sep 2001
    Posts
    4,428

    Re: Garbage Collector

    Quote Originally Posted by ntg
    I'm not sure there is such a thing. You can force a garbage collector run for your application by using System.GC.Collect().

    Cheers,
    NTG
    you need to call GC.WaitForPendingFinilizers() right after that
    rate my posts if they help ya!
    Extract thumbnail without reading the whole image file: (C# - VB)
    Apply texture to bitmaps: (C# - VB)
    Extended console library: (VB)
    Save JPEG with a certain quality (image compression): (C# - VB )
    VB.NET to C# conversion tips!!

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

    Re: Garbage Collector

    Quote Originally Posted by MrPolite
    you need to call GC.WaitForPendingFinilizers() right after that
    Why is that ?
    "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"

  10. #10
    l33t! MrPolite's Avatar
    Join Date
    Sep 2001
    Posts
    4,428

    Re: Garbage Collector

    Quote Originally Posted by ntg
    Why is that ?
    pauses your thread
    http://msdn.microsoft.com/library/de...izersTopic.asp


    umm to be honest I've been using it blindly. Back yay when I was learning about vb.net for the first time, I read in a book or wherever that you should always call that after gc.collect().... that isnt completely true I guess
    rate my posts if they help ya!
    Extract thumbnail without reading the whole image file: (C# - VB)
    Apply texture to bitmaps: (C# - VB)
    Extended console library: (VB)
    Save JPEG with a certain quality (image compression): (C# - VB )
    VB.NET to C# conversion tips!!

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

    Re: Garbage Collector

    Yeah, I thought that you should call that only if you need to wait for GC to finish. That would be the case if you need finalizers to finish their work and therefore release all resources.
    "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