Skip to content

Tracking down memory leaks in a WPF Application

February 15, 2007

Keywords: Memory Use Increasing, .Net, WPF, Memory Leak

Internal Thread…read from bottom:

From: Tim
This is something [User] should do – this isn’t in WPF code (if it were, we’d have a lot more loud customers and tests failing).  Rico has a pretty good post on using CLRprofiler to track these down:  http://blogs.msdn.com/ricom/archive/2004/12/10/279612.aspx

From: Adam
Here’s the link: http://www.microsoft.com/downloads/details.aspx?familyid=A362781C-3870-43BE-8926-862B40AA0CD0&displaylang=en

The included doc has great documentation for tracking down memory leaks.

From: Tim
You can use ClrProfiler to take snapshots of your app at two different points (e.g., before & after you create a bunch of these), to show you which objects are hanging around….

From: User

I improved the function as follow:

Void Execut()

{

{

CustomCanvas canvas = new CustomCanvas();

}

GC.Clollect();

GC.WaitForPendingFinalizers();

}

But the working set size still increased slowly.

If I deleted the code line “CustomCanvas canvas = new CustomCanvas();”, the working set size arrived a fixed value after a while.

Constructor function of CustomCanvas invoked function of InitializeComponent which was generated by compiler.

If constructor function didn’t invoke InitializeComponent, it’s ok.

InitializeComponent invoked System.Windows.Application.LoadComponent.

Who will give me a hand?

From: User
I write test code for WPF application.

One thread continues to call a function which just new a customized Canvas.

Void Execut()

{

CustomCanvas canvas = new CustomCanvas();

}

It is very strange that the Working Set continue to increase.

Canvas contains an unmanaged resource?

From → WPF

9 Comments
  1. Unknown permalink

    http://www.usome.com  http://www.usome.com 游商贸 B2B 3.0 电子商务 3.0 中国最强的电子商务搜索引擎 免费建立企业网站,浏览海量采购信息 游商贸 浏览海量采购信息 游商贸 网址导航 游商贸 新闻搜索

  2. Unknown permalink

    Welcome to enter (wow gold) and (wow power leveling) trading site, (wow gold) are cheap, (wow power leveling) credibility Very good! Quickly into the next single! Key words directly to the website click on transactions! -144277050205817

  3. Unknown permalink

    RMT 株式投資 結婚式 演出 太陽光発電 転職 看護師 釣具 会社設立 バイアグラ データ復旧 フローリング データ復元 投資 横浜 賃貸 ショッピング枠 現金化 データ復旧 テレマーケティング   

  4. Unknown permalink

    ウィークリーマンションオーク 不動産担保ローン データ復旧  ウエディング  お取り寄せグルメ 横浜中華街 キャッシング 害虫駆除 介護 釣り 結婚指輪  RAID復旧 ウエディングドレス 子宮筋腫 治験 メタボ対策
     

  5. Unknown permalink

    債務整理 手 汗 手掌多汗症 医師 求人 お見合い  就職ナビ 医師 募集 マンションリフォーム 永代供養 アンチエイジング 化粧品 特許事務所 ウォーキングシューズ 広告業界 アダルトグッズ 永代供養 会社設立 永代供養

  6. Unknown permalink

     マッスルトレーナー 納骨堂   東京都 墓地  有料老人ホーム サウナスーツ 美容学校 マンスリーマンション 東京 別れさせ屋 弁理士 メル友 住宅リフォーム 法律事務所 求人 アメリカ ビザ  脱腸 痔 医師 転職

  7. Unknown permalink

    Amberdigital Branch,Southern Stars Enterprises Co is specializing in the development and manufacturing of screen advertisings, digital sign, digital signages and LCDs. Established in 1996, we have explored and developed the international market with professionalism. We have built a widespread marketing network, and set up a capable management team dedicated to provide beyond-expectation services to our customers.

    amberdigital Contact Us
    Southern Stars Enterprises Co (Hong Kong Office)
    Add:3 Fl, No.2, Lane 2, Kam Tsin Tsuen, Sheung Shui, Hong Kong
    Tel:+852 2681 4099
    Fax:+852 2681 4586
    Southern Stars Enterprises Co (Shenzhen Office)
    Add:DE, 16/F, Building 2, Nanguo Tower, Sungang Road, Shenzhen, China
    Tel:+86 755 2592 9100
    Fax:+86 755 2592 7171
    E-mail:sstar@netvigator.com
    website:www.amberdigital.com.hk
    alibaba:amberdigital.en.alibaba.com[aicagd

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: