Skip to content

High memory consumption #94

@petyusa

Description

@petyusa

Hi,

I have an app that generates cards for a boardgame. The text varies a lot, so I set the fontsize dynamically, in a do/while loop, where I check if the textBox is Truncated or not. here's a simple example:

RichString textBox = null;
var fontSize = 1000;
do
{
    fontSize--;
    textBox = new RichString
    {
        MaxHeight = 512,
        MaxWidth = 512
    };
    textBox.Add("test test test test test", fontSize: fontSize);
} while (textBox.Truncated);

The issue is, if the while loop runs a lot, the memory consumption of my app skyrockets. Here's an example snapshot:
image

As you can see, there are more then 16 million StyleManagers, and there's a huge Dictionary<string, Topten.RichTextKit.Style>.
I'm not sure if it's a bug, or I misuse it. Can you have a look at it?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions