We are using a developer sandbox for development. When i go to System OverView > Business Logic > Code Used, i see that we have already use 96% of the amount of code we can write. Can we get it increased ? Or do we need to do some clean up. Different developers use same sandbox with different login credentials. When they work on same object, they create multiple copies and then finally merge. There are unused copies lurking around. But we dont have time to do cleanup now. Can we get it increased ?

  • My snarky (but really just kidding, sort of) comment is to find a new job, that's a ton of technical debt to inherit. – greenstork Apr 8 '15 at 19:45

You'll need to clean up your code. The 3,000,000 character limit is the universal limit for any namespace. I've found that the typical code base can be optimized by at least 50%.

Try this:

Delete all your unit tests (or comment them out). Then, start writing use-based unit tests, covering each page, trigger, etc that you know you need. Then, review the code coverage results when you run all these tests, comment out unused code, then manually test all the functionality and see if anything is broken.

If not, you're done. If so, write a unit test for whatever is broken, restore code until it's not broken, and repeat the process until you're done.

Having a veteran/expert at the code might be worth hiring a contractor for a period of time. A competent developer can optimize dozens or hundreds of lines of code a day.

Also, see this question. So, looks like you can increase the limit, if you can prove you've done due diligence and already optimized your code.


You can raise case with salesforce support to increase the character limit ,provided you have a valid reason.


Another option might be to create a new sandbox from PROD. Presumably PROD isn't cluttered up with developer experiments or in-flight work. Then, add back into the new sandbox the relevant development from within the 96% sandbox.

The above might be more problematic if you are doing your dev in a fullcopy sandbox as getting a second temporary fullcopy sandbox may require assistance from your sfdc rep


It can be increased. You can raise a request to Salesforce to increase code limit. In my previous organization we raised it twice. It was 12 Million characters, when I checked last time. I am not very sure, whether they will charge you for it. Please have a call with Salesforce support team. They will let you know the details.


I know this is pretty old question, just wanted to let people know that Salesforce increased the limit from 3MB to 6MB in Summer 18 release.


  • The question is basically unchanged by this update. In fact, it only serves to highlight the point made in the accepted answer. You can include a massive amount of logic within one org. – Adrian Larson Jun 27 '18 at 6:36

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.