function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Harshitha KudurHarshitha Kudur 

I am loading a huge xml to document object for parsing. But the heap size consumed in the enterprise edition is more than the developer edition.

I am loading a huge xml to document object for parsing. But the heap size consumed in the enterprise edition is more than the developer edition.

Following is the code snippet I used:
public class testhxmlclass
{
    public testhxmlclass ()
    {
    }
    public void LoadHTML()
    {
        try{
            String mappingXML='';
            StaticResource sr = [Select Id, body, Name from StaticResource where Name = testhxmlfile];
            mappingXML = sr.Body.toString();
            system.debug('Before :'+ string.valueof(Limits.getHeapSize()));
            Dom.Document Doc = new Dom.Document();
            Doc.load(mappingXML);
            system.debug('After :'+ string.valueof(Limits.getHeapSize()));
        }
        catch(exception ex)
        {
            system.debug(ex.getmessage());
        }
    }
}


In developer edition following is the result:
Before: 1176801
After: 2283440

In Enterprise edition following is the result
Before:1176801
After: 2435076

What could be the reason?
KevinPKevinP
Other meta data based tools like validation rules, assignment rules etc. that are different between your dev and production orgs can affect how much heap is used. 

Try converting your document from xml to json, and loading that way.