This is a migrated thread and some comments may be shown as answers.

High Mem Usage

1 Answer 53 Views
RichTextBox
This is a migrated thread and some comments may be shown as answers.
Jingmeng
Top achievements
Rank 1
Jingmeng asked on 06 Sep 2010, 06:00 AM
Hey,
i'm not quit sure if this is a bug, currently i'm working on server, so cant do debug test for this problem, because once it happen, all memory is in used and server is died, and i need reboot the server, 
what the problem looks like is I'm setting up a radrichtextbox coontrol in c# code, which is looks like 
protected RadRichTextBox getRadRichTextBox(string fieldname)
{
    RadRichTextBox _radRichTextBox = new RadRichTextBox
    {
        Name = fieldname,
        Margin = new Thickness(0),
        HorizontalAlignment = HorizontalAlignment.Stretch,
        VerticalAlignment = VerticalAlignment.Stretch,
        //Height = DefaultValues.DEFAULT_TEXTBOX_HEIGHT,
        //Width = DefaultValues.DEFAULT_TEXTBOX_WIDTH,
        FontSize = 5,
        BorderBrush = App.Current.Resources["Black"] as SolidColorBrush,
        BorderThickness = new Thickness(1)
    };
    return _radRichTextBox;
and i'd like comment the width and height to make it fill the grid, and i can easily change the width and height by dragging the splitter(there is a splitter between 2 grids) , the trouble is once i comment height and width, the memory usage of the project will become to more than 400,000k (normally it's 100,000k) and my computer is died because run out of memory.....(so said!!! really need new RAM)
btw, once i uncomment that 2 lines, it's becomes all good...

let me know if there is any news or maybe alternative way to make richtextbox size can be auto-adjusted by raddocument 
cheers
MENG

1 Answer, 1 is accepted

Sort by
0
Boby
Telerik team
answered on 08 Sep 2010, 03:55 PM
Hi Jingmeng,
Could you please send us sample project that reproduces the problem, or specify more details about your use case, for example how you add this RadRichTextBox to the grid?

We testes the simplest case, where there is one grid named 'LayoutRoot' in the user control, and your method is invoked in the following way:
private void UserControl_Loaded(object sender, RoutedEventArgs e)
{
    this.LayoutRoot.Children.Add(getRadRichTextBox("radRichTextBox"));
}
and the memory usage stays low.

Regards,
Boby
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Tags
RichTextBox
Asked by
Jingmeng
Top achievements
Rank 1
Answers by
Boby
Telerik team
Share this question
or