Numpy: running out of memory on one machine while accomplishing the same task on another

For my project I need to store two large arrays in memory at once. I try to create them as follows:

matrix_for_words_train  = numpy.zeros(shape=(435679, 542))
matrix_for_words_test = numpy.zeros(shape=(435679, 542))

However, on my desktop pc the second string resulted in MemoryError.When I tried to perform this on my laptop, I succeeded. What puzzles me here is that desktop has twice as much memory as laptop (8 GB versus 4). Both machines run on Ubuntu, desktop has 12.04 while laptop has 14.04 (both 32-bit) and on both machines I tried to execute above script with python 2.7
Just in case I checked the memory available with free and it seems OK (total memory is shown as expected and desktop has more than twice free memory). I guess I’m totally missing something here.
Thanks in advance!

Source: ubuntu

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.