I have a program where I basically adjust the probability of certain things happening based on what is already known. My file of data is already saved as a pickle
pickle
I had memory error and resolved it by using protocol=2:
cPickle.dump(obj, file, protocol=2)