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

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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T09:21:59+00:00 2026-05-26T09:21:59+00:00

I am profiling an application and noticed that 52% (195MB) of the memory is

  • 0

I am profiling an application and noticed that 52% (195MB) of the memory is being used by char[] and 20% by String. This is a large project with a lot of dependencies and I’ve just seen it so I have a couple of related questions to help me get started:

Does String s = "some text" create a char[]?

I’ve noticed there’s hundreds of String s = new String("some text") with no apparent reason. Is this the culprit?

  • 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-26T09:21:59+00:00Added an answer on May 26, 2026 at 9:21 am

    Does String s = “some text” create a char[]?

    This doesn’t create any objects.

    I’ve noticed there’s hundreds of String s = new String(“some text”) with no apparent reason. Is this the culprit?

    This creates a copy of the String and possibly the char[] (two objects). A copy is only taken if the String represents the substring of another string.

    I would ensure you have a version of Java which supports -XX:+UseCompressedStrings This is on by default in later versions of Java and allows the JVM to use byte[] instead of char[] which can be half the size.

    However, 400 MB isn’t that big these days and buy more memory may be the simplest solution. You can get 16 GB for as little as $120.

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

Sidebar

Related Questions

While profiling an application I noticed that RandomAccessFile.writeLong was taking a lot of time.
I am currently profiling my node.js application.I found this blog: http://blog.nodejs.org/2012/04/25/profiling-node-js/ that suggests I
while profiling NHibernate with NHProf I noticed that a lot of time is spend
I've got this webapp that needs some memory tuning. While I'm already profiling the
I have noticed that my application is causing a substantial memory leak in firefox
I noticed this particular line of code when I was profiling my application (which
Recently I noticed my application appears to be eating memory that never gets released.
I am profiling an application suddenly using a lot of memory, and i am
while profiling a java application that calculates hierarchical clustering of thousands of elements I
I'm running through some memory profiling for my application in SDK 3.2 and I

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.