0

I have some php scripts that are parsing huge amounts of data from csv files (100gb+) into MYSQL tables. I want to allocate every possible amount of memory to this task.

Does this line of code allow me to increase the memory allocated to the script and if so what is the max amount of RAM I can set it to?

ini_set('memory_limit', '2G');

My PC has: Windows 8 16gb RAM

5
  • 1
    May be you need to chunk data and make some cron jobs with your app. Btw your question is unclear. Commented Aug 24, 2014 at 19:45
  • The 100gb is not true imho Commented Aug 24, 2014 at 19:56
  • How do you expect to keep 100G of data in 2G of memory? Commented Aug 25, 2014 at 1:12
  • Does the ini_set('memory_limit', '2G') mean I can only parse 2GB of data? If not, how much can I parse at most? Ive heard with Windows 8 I have more resources. I am hoping for something constructive rather than sarcastic comments. Thank you. Commented Aug 26, 2014 at 3:00
  • @ArjunSingh oh well, you can do it with 2 gb ram via chunking data for eg 100 mb. It spends a lot of time and time == money (primarily opinion based.) As @pguardiario said; how do you keep a huge data with a small memory? I also dont recommend inserting a big data to mysql via php. Find a better way. Commented Aug 26, 2014 at 8:25

2 Answers 2

1

No, shorthand notation works only in php.ini ( http://php.net/manual/en/faq.using.php#faq.using.shorthandbytes ). Use integer value in bytes instead.

Sign up to request clarification or add additional context in comments.

Comments

0

yes this line of code should work, but why do you make this in php for 100gb+ :O ?

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.