Skip to content

Fix string size #34052

@Rick-Anderson

Description

@Rick-Anderson

Description

Updated size of string from 10KB to 20KB according to

Note: Strings are stored as UTF-16 characters in .NET so each char takes two bytes in memory.

but also after running

Console.WriteLine(
    System.Text.Encoding.Unicode.GetByteCount(
        new String('x', 10 * 1024)));

// Answer: 20480

Page URL

https://learn.microsoft.com/en-us/aspnet/core/performance/memory?view=aspnetcore-8.0&branch=pr-en-us-33937

Content source URL

https://github.com/dotnet/AspNetCore.Docs/blob/main/aspnetcore/performance/memory.md

Document ID

06ca8420-5ca0-24ae-3584-9a4c486d3ebe

Article author

@tdykstra

Related Issues


Associated WorkItem - 340828

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions