Querying channel entries hits memory limit We have a channel that has about 700 entries but is paginated with a limit of 30 entries. Our client is looking to add a button so users can print out all entries. One of our proposed solutions was to redirect to a stripped down page (no header, footer, etc.) with all of the filtered entries that automatically engages the browser's print method. The problem is if no filters have been applied, Craft can't handle 700 entries (I've tested a bit and 130 seems to be the limit).

How should one go about this? Is upping our memory limit (currently 128M) the only way around this? Would it be better to generate a JSON object on channel entry save that we could then load in the print page's template?

Any suggestions would be appreciated!

EDIT

Here is some additional information. The page is basically just a list of companies. There is a field for the company's name, address, contact name, telephone, email, website, type (category), country (category), and also SEOmatic (which we obviously don't need to display). I haven't actually looked at the tables, though.

The error I am getting:

Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 79 bytes) in /Library/WebServer/Documents/site/craft/app/fieldtypes/PlainTextFieldType.php on line 59

EDIT 2

Channel: Companies

Field Layout:


Meta: SEOMatic (don't need to output)
Company Name: Plain Text
Company Address: Plain Text
Company Contact Name: Plain Text
Company Email: Plain Text
Company Telephone: Plain Text
Company Website: Plain Text
Company Type: Category (there can be MULTIPLE types, doesn't have any fields associated with it)
Company Country: Category (there can only be ONE type, doesn't have any fields associated with it)


Categories:


Company Types
Company Countries
Assuming you're referring to Craft 2, the EntryModels that get returned to a template do have a significant memory overhead attached to them you're probably running into.  Doing the math, even bumping your php.ini memory_limit up to 256M is only going to get your around 260 results coming back with your given fields/configuration.

It's one of the big things we first improved in the upcoming Craft 3.

In the meantime, you've got a couple of options:


Paginate the results so you can do them in smaller batches.
AJAX/lazy load the results over multiple requests in smaller batches.
Write a plugin (https://craftcms.com/docs/plugins) that bypasses Craft's Element/Model loading and queries the database directly and returns only the data you explicitly need back to the template, without all of the model overheard.