How do I get my Amazon EC2 instance to allocate more memory?

-1

I am working on a deep learning Neural Network project using NumPy. My laptop, which has 4 GB of RAM, has no problem preprocessing the data. However, that same preprocessing step causes a MemoryError on my p2.xlarge EC2 instance, which has 61 GiB RAM. Unfortunately, I can't seem to find a way to contact Amazon just to verify there is nothing else I can do, without buying a support plan.

moonman239

Posted 2018-04-19T18:14:47.987

Reputation: 167

Question was closed 2018-04-19T20:40:50.613

If it works fine on a machine with 4 GiB then the problem isn't the amount of memory the EC2 instance has. As for an answer to your question, you typically would create a new EC2 instance, that has been allocated more memory. – Ramhound – 2018-04-19T18:49:30.730

@Ramhound: I don't understand. If I'm supposed to be able to access 61 GiB of RAM, then why would I need another instance? – moonman239 – 2018-04-19T19:22:23.390

Which is my point? If your current instance has 62 GiB, but a system with 4 GiB functions properly, then the problem isn't the amount of memory the EC2 instance has (you already have several times more then you should need). – Ramhound – 2018-04-19T21:45:13.053

Answers

2

You can stop your instance, right click, then Instance Settings -> Change Instance Type.

You can then upscale or downscale the instance as needed.

That said, if it works fine on your laptop, the amount of memory allocated to the instance isn't a problem. Chances are you have something in your configuration causing it to overallocate RAM to the NumPy process.

maplebird

Posted 2018-04-19T18:14:47.987

Reputation: 121

Thanks for the input. How do I stop it from overallocating RAM to NumPy? – moonman239 – 2018-04-19T19:38:36.790

@moonman239 - Determine the configuration change between the working machine and the EC2 instance. – Ramhound – 2018-04-19T21:45:40.087

Ok, how do I do that? I don't know too much about administering computers. – moonman239 – 2018-04-20T07:57:17.540