Out of memory error processing a file
franztini said 10 months, 3 weeks ago:
I have a script that parses a large file (approximately 250mb) and I keep getting out of memory errors. I have manually run the process and watched my server utilization and it does not even spike. free -m shows 1722 free; I was going to create a virtual memory partition but searched this forum and it looks like it might be something that the server team should look into
Gary A said 10 months, 3 weeks ago:
@franztini
The error is likely related to the type of script. If it is a php script processed through a browser, you will want to ensure that your PHP configuration allows enough memory to PHP.
If you would like our Server Support team to investigate your server, you can submit a Trouble Ticket for your server. Information on creating a Trouble Ticket can be found here:
http://support.godaddy.com/help/article/4596/creating-trouble-tickets-for-your-server
-Gary
franztini said 10 months, 3 weeks ago:
@Gary,
It is a perl script that parses the XML files. The perl script successfully processes multiple files except the one large one, however the next largest file is only 20mgs. Any thoughts?
Gary A said 10 months, 3 weeks ago:
@franztini
I am not familiar with Perl scripting, so I am not sure how it allocates memory. Perhaps another member with experience in Perl will be able to offer a solution. You may also want to check you issue on a Perl specific site to see if you are able to find additional information relating to this.
-Gary
franztini said 10 months, 2 weeks ago:
@Gary,
Hope you had a great 4th! After researching other sites, perl uses all available memory – RAM and swap partition/files. Our current server has similar specs as this VM (2gb RAM), but it also has 2gb of virtual memory. Our current VM does not have any swap partition/file and I would like to create one. However, in researching whether you can create a swap partition/file in a VM, I am getting conflicting information. So, can I add a swap partition (using this command dd if=/dev/zero of=/path/to/swapfile count=$NUMBER_OF_MB_REQUIRED bs=1M) within my VM and not break it?
Gary A said 10 months, 2 weeks ago:
@franztini
You should be able to create a swap file without any issues on a Virtual Dedicated server. You will want to keep in mind that it will take up space of your available storage space.
-Gary
franztini said 10 months, 2 weeks ago:
@Gary
Great – hopefully this will solve my problem. Thanks for the quick response.
Gary A said 10 months, 2 weeks ago:
@franztini
Glad I could help. If you have any other questions, please feel free to post them on the Forums.
-Gary
8 min expected wait time