We have a salesforce org running a large customized crm application, integrations and a large customer portal force.com site. Everything is well managed and running fine, but based on a lot of Apex ... we've hit the 3MB apex governor limit.

The maximum amount of code used by all Apex code in an organization is 3 MB.

The error message is actually phrased as:

Error: The total size of apex code in this application after removing comments exceeds the maxiumum character size of 3000000

(including the spelling error)

We know that there still are old testMethods not in @isTest annotated classes, but even after cleaning those up, how can we avoid running into this again in the future. Is this a limit that can be raised through SF support ?

  • 1
    I think yes and would better ask SF support directly. – Sergej Utko May 28 '13 at 8:03
  • 1
    Community can be much faster than Sf support, and this gets the information out there, available to all. – Samuel De Rycke May 28 '13 at 22:02

Yes. I have worked with Orgs where this limit has been increased. Raise a case with SF support.
A few have had it increased to 6MB
I am sure if you explain the steps that you have taken (cleaning up the code and checking for test methods) then this will aid your case.


As per Salesforce Summer ’18 Release Note (preview), Apex Code Size Limit has been increased.

The maximum amount of Apex code that you can use in an org has been doubled, from 3 MB to 6 MB. If your org was previously approved for an increase above 6 MB, it remains unchanged.

Where: This change applies to Lightning Experience and Salesforce Classic in Enterprise, Performance, Unlimited, and Developer editions.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.