Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[CLI] database:export "Allowed memory size bytes exhausted", php 7.4, J4 #30475

Open
bato3 opened this issue Aug 25, 2020 · 2 comments
Open

[CLI] database:export "Allowed memory size bytes exhausted", php 7.4, J4 #30475

bato3 opened this issue Aug 25, 2020 · 2 comments

Comments

@bato3
Copy link

bato3 commented Aug 25, 2020

Steps to reproduce the issue

Default php 7.4 configuration from XAMMP,
389597 rows in #_finder_terms (127.9 MB on disk)

php cli\joomla.php -vvv --table=jos37_finder_terms database:export

Actual result

Exporting Database
==================

 Processing the jos37_finder_terms table
PHP Fatal error:  Allowed memory size of 536870912 bytes exhausted (tried to allocate 67108872 bytes) in C:\xampp\htdocs\libraries\vendor\joomla\database\src\DatabaseExporter.php on line 299

Fatal error: Allowed memory size of 536870912 bytes exhausted (tried to allocate 67108872 bytes) in C:\xampp\htdocs\libraries\vendor\joomla\database\src\DatabaseExporter.php on line 299
Symfony\Component\ErrorHandler\Error\OutOfMemoryError^ {#390689
  -error: array:4 [
    "type" => 1
    "message" => "Allowed memory size of 536870912 bytes exhausted (tried to allocate 67108872 bytes)"
    "file" => "C:\xampp\htdocs\libraries\vendor\joomla\database\src\DatabaseExporter.php"
    "line" => 299
  ]
  #message: "Error: Allowed memory size of 536870912 bytes exhausted (tried to allocate 67108872 bytes)"
  #code: 0
  #file: "C:\xampp\htdocs\libraries\vendor\joomla\database\src\DatabaseExporter.php"
  #line: 299
}

System information (as much as possible)

  • PHP 7.4.9 (cli) (built: Aug 4 2020 11:52:41) ( ZTS Visual C++ 2017 x64 )
  • Joomla! 4.0.0-beta3 (debug: No) (not fully upgraded, but i put files by FTP, and database version: 4.0.0-2020-05-29 )

Additional comments

I know, that I can reconfigure server, but I think we should find a solution that requires less memory.

@Hackwar
Copy link
Member

Hackwar commented Aug 29, 2023

I've opened an issue on the database repo: joomla-framework/database#287

@Hackwar
Copy link
Member

Hackwar commented Apr 2, 2024

So the solution to this issue would be to stagger reading and writing the data from the table during export. Limit the number of rows to read, then write them to a file resource, read the next batch and write it again until done. This is a bigger refactoring and I'm unsure if our Filesystem package properly supports this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants