I recently ran into heap size limit, where I was having a list with over 1000 records.

I resolved that by using the setcontroller for pagination. But now I need to render that page as PDF.

When I do a renderas=pdf will it also hit the heap size limit?

  • 2
    Yes I believe you will, it won't make a difference whether you render as HTML or PDF since the heap will be the same each time. I've certainly seen the heap size blown when generating PDFs Jun 20, 2013 at 6:53

1 Answer 1


The heap size limits will apply when rendering as PDF.

When you say you had problems with lists with over 1000 records, was the error there heap size or the maximum list size that iteration components can handle? If the latter, you can always use the readOnly attribute on the page, this relaxes the governor limits so that iteration components can handle up to 10,000 records.

You'd still be bound by the heap size limit though, so it sounds like you would need to look at slimming down the records that you are retrieving, by not retrieving fields that you won't be rendering for example.

  • i hit the heapsize limit.. when i checked the heap size, this list was using up >135kb. Thanks for letting know about the readonly attribute.
    – Prady
    Jun 20, 2013 at 8:23
  • 2
    Heapsize limit is 6mb, this is different from the viewstate limit of 135kb
    – Doug B
    Jun 20, 2013 at 9:13
  • 2
    If you are hitting the viewstate limit, make your list transient, as you aren't changing anything in PDF anyway. Jun 20, 2013 at 10:56

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .