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

  • SEARCH
  • Home
  • 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 3809884
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T15:22:28+00:00 2026-05-19T15:22:28+00:00

I have a problem in my app and I don’t know if it is

  • 0

I have a problem in my app and I don’t know if it is normal or not.
I have a textblock in my application that needs to display a large amount of text (2000-4000 chars). Anyway there is a limit of 2048 pixels I think so my text is cropped, this is no problem, I use this : http://blogs.msdn.com/b/priozersk/archive/2010/09/08/creating-scrollable-textblock-for-wp7.aspx .

The problem is that the longer the text the more memory it consumes. Without the very long text hack from the link above, the textblock consumes around 10mb of memory!
If I use the ScrollableTextBlock from the link above, the amount of memory is going even further and can reach up to 30-40 mb.. There is no limit.
So it seems that the memory usage is related with the area that is drawn…

Is there a way to reduce memory usage for long texts? Has BitmapCach anything to do with this problem and can I disable it? You can easily reproduce this problem by just adding a textblock with a very long text and you can check memory usage with this code, you will see that with just 1 textblock with long text, the peak memory goes up by 10mb or more:

        long deviceTotalMemory = (long)DeviceExtendedProperties.GetValue("DeviceTotalMemory");
        long applicationCurrentMemoryUsage = (long)DeviceExtendedProperties.GetValue("ApplicationCurrentMemoryUsage");
        long applicationPeakMemoryUsage = (long)DeviceExtendedProperties.GetValue("ApplicationPeakMemoryUsage");

        Debug.WriteLine("### deviceTotalMemory             : " + deviceTotalMemory);
        Debug.WriteLine("### applicationCurrentMemoryUsage : " + applicationCurrentMemoryUsage);
        Debug.WriteLine("### applicationPeakMemoryUsage    : " + applicationPeakMemoryUsage);
  • 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-19T15:22:29+00:00Added an answer on May 19, 2026 at 3:22 pm

    I came across similar issues when creating Overflow7

    The problems I encountered were to do with the fact that if you use a StackPanel inside a ScrollViewer, then the ScrollViewer insists that all of the StackPanel is rendered, not just the visible portion.

    I read around and there were 2 general solutions:

    • use UI virtualization techniques – e.g. VirtualizingStackPanel
    • use data virtualization techniques – e.g. crafting your own paging

    To get round this in Overflow7 I made use of ListBoxes instead of the ScrollViewer/StackPanel combo. The internals part of ListBox use a VirtualizingStackPanel – and this VirtualizingStackPanel renders just whats on the screen, not the entire scrollable client area.

    This was a bit “hacky” but worked well. If you have time, then I believe a better solution would be to improve the ScrollableTextBlock implementation so that it uses VirtualizingStackPanel – there are good posts about how to use this on (for example) WPF VirtualizingStackPanel for increased performance

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

Sidebar

Related Questions

I have a problem that I'd like to solve, but I don't know how
I have a problem with the understanding MVC architecture. It's not that I don't
Problem: We have a web app that calls some web services asynchronously (from the
I have a problem with writing cookies in cakephp and even don't know how
I don't know why. Install the package directly won't have any problem. But will
I have a little problem with plists. I don't know how to read data
I wrote a little PyGTK app: Workcycler Now I have the problem that I
i have little problem with boost::asio library. My app receive and process data asynchronously,
I am building my first ASP.Net MVC based app and have a problem accessing
Problem 1: I have a simple winforms app and I want to DataBind my

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.