+ Start a Discussion

Eclipse hangs when opening Lead object with 500 custom fields

The Lead object in our org has over 500 custom fields; we got SFDC to extend the custom  field limit.


When I try to open the metadata for my Lead object, Eclipse just hangs.  I've waited for over 30 minutes but no joy.  The actual metadata file is over 8 MB.


Any suggestions?


Mike (Gordy) Gordon


Have you tried increase the eclipse heap size - maybe it's running out of memory




There are limits to the metadata api - but I don't think you are hitting them


Eclipse is a pretty heavyweight editor to try to use for such a large XML file. I've run into the same issue with ~10MB metadata files, and the 5MB ones are no fun either. The metadata API works fine with files of this size, and in fact I've refreshed/deployed these files without issue via the Eclipse/Force.com IDE -- it's the editor that's the problem.


I've taken to using a lighter-weight editor to view the XML and make necessary modifications, then use the Force.com IDE strictly to deploy the changes. I run a Mac, and Smultron has been fine for this pupose, but the stock TextEdit program is even more lightweight, in case of any really ridiculously large files. I suppose you could modify Eclipse preferences to use a plain text editor for XML files, but I like their XML editor for smaller metadata files and XSLT, etc. You could also give XCode a try (again, if you're on a Mac). 


Keep in mind that if you're getting metadata files that large, it's almost certainly caused by having several RecordTypes in combination with large/unfiltered picklist fields. Each picklist field gets its full listing of record-type filtered values duplicated, for each recordType, into the recordTypes subtree of the XML (this multiplies out to a large size very quickly). My large XML files had like 95% of their size accounted for by this. Depending on your circumstances, you can cut out this section, and Salesforce will still properly merge the rest of your metadata changes on an upload (but will put it  all back in the merged/updated version it sends back down to you).