Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7070169
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T05:32:02+00:00 2026-05-28T05:32:02+00:00

How to Free RAM at Silverlight/WPF ? I define a UserControl MyUC that has

  • 0

How to Free RAM at Silverlight/WPF ? I define a UserControl MyUC that has a Image and three Textblock. I add 10000 MyUCs to a Grid, then clear the Grid’s Children,but RAM is not Freed! Why?
MyUC:

<Grid x:Name="LayoutRoot" Background="White">
    <Grid.ColumnDefinitions>
        <ColumnDefinition Width="32"/>
        <ColumnDefinition Width="Auto"/>
    </Grid.ColumnDefinitions>
    <Image Grid.Column="0" Source="{Binding ICO}" Width="32" Height="32"/>
    <StackPanel Grid.Column="1" Orientation="Vertical" Width="359" Margin="0,0,-189,0">
        <TextBlock Text="{Binding ID}"/>
        <TextBlock Text="{Binding Name}"/>
        <TextBlock Text="{Binding URL}"/>
    </StackPanel>
</Grid>

Code:

MyUC uc = null;
for (int i = 0; i < 10000; i++)
{
  uc = new MyUC();
  this.LayoutRoot.Children.Clear();
  this.LayoutRoot.Children.Add(uc);
}

Help me? 3KS!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-28T05:32:03+00:00Added an answer on May 28, 2026 at 5:32 am

    The short answer is you don’t do anything explicit to release memory in the case you have provided.

    As each instance of your MyUC class goes out of scope, the Garbage Collector will determine that it is no longer reachable. At the next garbage collection, the unreachable instances will be ‘marked’ and the memory will be compacted. It’s all fundamental to how .NET works.

    Whether or not your diagnostic for measuring memory is detecting the effects of garbage collection is another story, and you didn’t provide any info on what diagnostics you are using.

    Garbage collection in the Microsoft .NET common language runtime environment completely absolves the developer from tracking memory usage and knowing when to free memory. However, you’ll want to understand how it works. Part 1 of this two-part article on .NET garbage collection

    Source: Jeffery Richter Garbage Collection: Automatic Memory Management in the Microsoft .NET Framework

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

free shows that My centos system used 4/11 Gb RAM, but I can't pinpoint
I need a multiplatform library to determine how much RAM the OS has free,
All, I would like to free up ram on my android for a data
How can I get the current system status (current CPU, RAM, free disk space,
Free Expression Blend 4 for Windows Phone, Silverlight and XNA in all their glory...
Any free control to view PDF for Silverlight? or how to view pdf in
Feel free to close and/or redirect if this has been asked, but here's my
Is there any (hopefully free/open source) code available that does native TLS/SSL communication? I
Is there a way to find out how much free RAM required to render
Is there a way to fill the free RAM on a linux machine with

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.