Fatal error Allowed memory limit
Fatal error Allowed memory limit
nisliwow
Posts: 4Questions: 2Answers: 0
Hello,
I have generated editor via https://editor.datatables.net/generator/index.
When table is requested, i get fatal error: Fatal error: Allowed memory size of ... bytes exhausted in ...
Table size is ~40 MBs. Am I doing sth wrong or just editor can't load this MBs of db?
Thanks in advance.
My Table:
<thead>
<tr>
<th>col1</th>
<th>col2</th>
<th>col3</th>
<th>col4</th>
</tr>
</thead>
My SQL:
CREATE TABLE IF NOT EXISTS `table` (
`id` int(10) NOT NULL auto_increment,
`col1` numeric(9,2),
`col2` numeric(9,2),
`col3` numeric(9,2),
`col4` numeric(9,2),
PRIMARY KEY( `id` )
);
PHP:
Editor::inst( $db, 'table', 'id' )
->fields(
Field::inst( 'col1' ),
Field::inst( 'col2' ),
Field::inst( 'col3' ),
Field::inst( 'col4' )
)
->process( $_POST )
->json();
This question has accepted answers - jump to:
This discussion has been closed.
Answers
Try enabling server-side processing.
How large is your database table? With client-side processing the whole table needs to be loaded into memory, which can cause issues with large tables.
Allan
I have enabled, still same error for 1.2M rows. I have decreased the test db into 30k rows, it successfully loaded.
I have added this to php page
ini_set('memory_limit', '10G');
still no luck, is this normal not to be able to load this big data and i should load it by chunks?
Did you also set DataTables to POST its request? If you post a link to the page I'd be happy to take a look at it and offer some help.
Allan
Last edit, setting POST seemed to work for my case. Thanks Allan.