Keep in mind the NAS OS and various packages require a certain amount of ram as well. To check how much ram is on your NAS, log in to DSM, select
Control Panel and the select
Info Center. About line six you will see the total physical memory on your machine.
To change the PHP memory limit go to
Web Station. Select
PHP Settings and then select the PHP version you want to change and click
Edit. Then select the
Core tab. Scroll down to
memory_limit. The default value is 128M. This value limits the memory used by each PHP script running on your machine.
I have never had to set this value higher than 128M. Keep in mind if you increase this value and have multiple programs running the same PHP profile, memory will be increased for all of them. If you are using virtual hosts you can increase the memory for one PHP program by creating a unique PHP profile. Modify the memory for that profile and then assign it to the host that runs the PHP program requiring more memory. You can also uncheck extensions that are not required to save more memory.
If you make changes you should periodically monitor your NAS to ensure you did not create a problem. The easiest way to do this is use the DSM widgets. If you are not familiar with the widgets, the widget icon is located at the upper right corner of the DSM desktop screen.
If you do not have any widgets, click the plus sign in the upper left corner.
The pop menu will show the available widgets.
I recommend using System Health because it shows the overall status of your DiskStation.
To monitor RAM, select Resource Monitor which will show the CPU and RAM usage as well as the LAN transfer rate.
To remove any widget, click the plus sign and then select the widget to remove.
Note that increasing the PHP memory limit will not eliminate 504 timeout errors. In some cases you can reduce these errors by running TNG in NGINX.
Since your program ran for "hours" without completing, I suspect there is something amiss with the geocode program. Well behaved programs usually time themselves out after a certain time period releasing resources and then exiting.