geonames icon indicating copy to clipboard operation
geonames copied to clipboard

error seeding

Open carlituxman opened this issue 9 years ago • 9 comments

I've executed php artisan geonames:import --country="ES" and fails after a while.

here console last output: .... Seeded: ContinentsTableSeeder Seeded: CountriesTableSeeder Seeded: AdminDivionsTableSeeder Seeded: AdminSubdivionsTableSeeder [Symfony\Component\Process\Exception\RuntimeException]
The process has been signaled with signal "11".

carlituxman avatar Mar 11 '15 18:03 carlituxman

I've tried with all countries and put at importer a ini_set('memory_limit', '-1'); but: [RuntimeException]
php(690,0xa04c11d4) malloc: *** mach_vm_map(size=262144) failed (error code
=3)
*** error: can't allocate region
*** set a breakpoint in malloc_error_break to debug
PHP Fatal error: Out of memory (allocated -746848256) (tried to allocate 3
2769 bytes) in /Users/carlituxman/dvp/laravel/geonames/vendor/ipalaus/geona
mes/src/Importer.php on line 332
php(690,0xa04c11d4) malloc: *** mach_vm_map(size=262144) failed (error code
=3)
*** error: can't allocate region
*** set a breakpoint in malloc_error_break to debug

carlituxman avatar Mar 12 '15 12:03 carlituxman

the problem is with the last line of file allCountries.txt: 5927710 Coral Lake Coral Lak

carlituxman avatar Mar 12 '15 18:03 carlituxman

Hey @carlituxman, I'll try to give it a go this week but I'm a little bit busy. Even tho, it's weird that allCountries.txt is the file that gives the error when you're trying to import the "ES" countries.

ipalaus avatar Mar 16 '15 08:03 ipalaus

I need to put ini_set('memory_limit' '-1') for correct execution with ES countries. With allCountries.txt is impossible, I need unzip manually because the file only have 348mb, and the error of Coral Lake not happen, but it throws out of memory.

carlituxman avatar Mar 16 '15 08:03 carlituxman

Well, that's normal as it's an intense use. I'm not sure a ini_set() should be in the core. I'm pretty sure my php.ini for CLI has a no memory limit. Using symfony/process I'm trying to get rid of most of the memory leaks that the command can generate.

You could also do php -d memory_limit=128M artisan geonames:import. Give it a go so you don't have to touch your php.ini.

ipalaus avatar Mar 16 '15 08:03 ipalaus

Error after AdminSubdivionsTableSeeder [RuntimeException]
PHP Fatal error: Allowed memory size of 134217728 bytes exhausted (tried t
o allocate 32769 bytes)

carlituxman avatar Mar 16 '15 09:03 carlituxman

Can you do a local edit to https://github.com/ipalaus/geonames/blob/master/src/Commands/ImportCommand.php#L234 ? Add the memory limit command after the php execution and try.

ipalaus avatar Mar 16 '15 09:03 ipalaus

error too

[RuntimeException]

PHP Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 32769 bytes) in /Users/carlituxman/dvp/laravel/geonames/vendor/ipalaus/geonames/src/Importer.php

carlituxman avatar Mar 16 '15 09:03 carlituxman

Any news on this?

cmoralesweb avatar Sep 07 '15 20:09 cmoralesweb