Skip to page contentSkip to chat
ServiceNow support
    • Community
      Ask questions, give advice, and connect with fellow ServiceNow professionals.
      Developer
      Build, test, and deploy applications
      Documentation
      Find detailed information about ServiceNow products, apps, features, and releases.
      Impact
      Accelerate ROI and amplify your expertise.
      Learning
      Build skills with instructor-led and online training.
      Partner
      Grow your business with promotions, news, and marketing tools
      ServiceNow
      Learn about ServiceNow products & solutions.
      Store
      Download certified apps and integrations that complement ServiceNow.
      Support
      Manage your instances, access self-help, and get technical support.
Server side script fails with error "String object would exceed maximum permitted size of 33554432" | Troubleshooting - Support and Troubleshooting
  • >
  • Knowledge Base
  • >
  • Support and Troubleshooting (Knowledge Base)
  • >
  • Server side script fails with error "String object would exceed maximum permitted size of 33554432" | Troubleshooting
KB0749085

Server side script fails with error "String object would exceed maximum permitted size of 33554432" | Troubleshooting


14954 Views Last updated : Jun 12, 2025 public Copy Permalink English (Original)
  • English (Original)
  • Japanese
KB Summary by Now Assist

Issue

Encountering server-side scripting failures with the error String object would exceed maximum permitted size of 33554432? Find information and fixes below.

Steps to reproduce

  1. in /sys.scripts.do
  2. paste the following code:
var abc = "a"; 
try {
for (i=1;i<30;i++) {
gs.print("current length: " + abc.length);
gs.print("current size: " + (abc.length)*2);
gs.print("Attempting to increase string size to: " + (abc.length)*4);
abc = abc + abc;
}
}
catch (e) {
gs.print("error: " + e);
}
gs.print(abc.length);

Release

Zurich

Cause

  • The platform has a default value of 32 MB for the String object and it is not advisable to significantly increase this limit.
  • This issue has been mostly seen to happen when script includes are instantiated in a while loop. Note that the limit may be breached when other scripts invoke a ScriptableObject, for example instantiating a script include, in a while/for loop where a GlideRecord object is passed into the script include inside the while loop. The object size grows with each loop iteration because we are adding up the GlideRecord object with each loop. One way to cause this is to loop with each GlideRecord result, and then call a script include.
  • This error will also occur if you assigned a lot of data to a new glide record object.

Resolution

To resolve this issue, make sure that what every string object defined doesn't grow beyond 32 MBs (33,554,432 Bytes) in any of the server side scripting.

NOTE: Javascript uses 2 bytes per character and there is a String object limit of 33554432 bytes.


The world works with ServiceNow.

Sign in for more! There's more content available only to authenticated users Sign in for more!
Did this KB article help you?
Did this KB article help you?

How would you rate your Now Support digital experience?

*

Very unsatisfied

Unsatisfied

Neutral

Satisfied

Very satisfied

Very unsatisfied

Unsatisfied

Neutral

Satisfied

Very satisfied

What can we improve? Please select all that apply.

What are we doing well? Please select all that apply.

Tell us more

*

Do you expect a response from this feedback?

  • Terms and conditions
  • Privacy statement
  • GDPR
  • Cookie policy
  • © 2025 ServiceNow. All rights reserved.