Skip to content

Fix string size #34052

Closed
Closed

Description

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Type

    No type

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions