3

Can we store more than 500000 items into a list in apex? I tried this and is working fine. So the limit of 50000 has been lift up? When this update was made to salesforce? any idea?

10

As per the documentation, there is no fixed limit on the size of collections now, but you are constrained by the available heap size:

There is no limit on the number of items a collection can hold. However, there is a general limit on heap size.

The previous limit was removed in the Spring '10 release, and is documented in the release notes.

5
  • 1
    This update was made in the Spring 10 release I think. "Collection Limits Removed - Limits on the number of items in a collection has been removed. However, there's still a general limit on heap size" Apr 18 '13 at 3:45
  • Does that also applies to the VF page if we are iterating over a list which consist more than 10000 items?
    – doga
    Apr 18 '13 at 4:00
  • 1
    As far as I know VF pages still have the smaller limit, and that'll be because the data needs to be sent back and forwards in the view state. If you need to display 1000+ records in a page you're probably not filtering / summarising very well!
    – Matt Lacey
    Apr 18 '13 at 4:43
  • 2
    Agree if your trying bring back 1000+ records you need to review your design. Regardless, the VF docs say this, "Visualforce iteration components, such as <apex:pageBlockTable> and <apex:repeat>, are limited to a maximum of 1,000 items in the collection they iterate over." salesforce.com/us/developer/docs/pages/Content/… Apr 18 '13 at 4:53
  • 3
    You can have more than 1000 items in a VF page but you'll need to use the @ReadOnly Apex annotation and set your VF page's readonly attribute to true. This will let you iterate over 10k records. salesforce.com/us/developer/docs/pages/Content/…
    – Wes Nolte
    Apr 18 '13 at 8:58

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.