New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
PEP MemoryError with a lot of available memory gc not called #43690
Comments
Also the gc behavior is consistent with the Example 1: This example will crash on any any PC with less then |
Logged In: YES Perhaps better than checking before every memory allocation, That way there is only the gc hit once there is low memory. So... res = malloc(...);
if(!res) {
gc.collect();
}
res = malloc(...);
if(!res) {
raise memory error.
} |
Logged In: YES This is very difficult to implement. The best way might be Contributions are welcome and should probably start with a |
Logged In: YES This is exectly what I meant. |
Logged In: YES Sorry, my last comment was to illume (I am slow typer :( ) |
Logged In: YES Doing it everywhere would be a lot of painful changes. Adding the "oops, failed, call gc and try again" to to Whether it is safe to call gc from there is a different |
Logged In: YES Another problem related to the above example: there is a |
Logged In: YES The example is highly constructed, and it is pointless to |
Lowering priority since, as Martin said, it shouldn't be needed in |
It looks like the severity of this problem is underestimated here. A programmer working with a significant amount of data (e.g SciPy user) I apologize that my example is artificial. I had a real-life program of |
I'm not sure what we should do anyway. Your program will first swap out |
Hi all, I'm joining Mark's assertion - this is a real issue for me too. I've stumbled into this problem too. Currently I'm getting MemoryError when I try to use the entire dataset, both on linux and on windows, python 2.5 on 64bit 4gb mem machine. (The windows python is a 32bit version though cause it needs to be compatible with some dlls. This is the same reason I use python 2.5) |
How about calling gc.collect() explicitly in the loop? |
Sure, that's what i'll do for now. Its an ok workaround for me, I was just There's also a scenerio where you couldn't use this workaround - for example On Wed, Aug 18, 2010 at 6:13 PM, Ray.Allen <report@bugs.python.org> wrote:
|
Anybody *really* interested in this issue: somebody will need to write a PEP, get it accepted, and provide an implementations. Open source is about scratching your own itches: the ones affected by a problems are the ones which are also expected to provide solutions. |
You are right, ofcourse... I haven't got the time for doing the right thing, (not sure its for this thread though but...) Windows on default limits the It works for me since it gives me x2 memory on my 64 bit os. On Wed, Aug 18, 2010 at 9:27 PM, Martin v. Löwis <report@bugs.python.org>wrote:
|
Mark, are you sure that the above program is sure to cause a crash. I had absolutely no problem running it with Python 3.1.2. With Python 2.6.5, PC went terribly slow but the program managed to run till i==14 without crashing. I did not wait to see if it reaches 700. I'm running it on XP. |
See bpo-1449496 if you are interested in that. |
This is what I got on computer with 512 MB RAM: Mandriva Linux 2009.1 Microsoft Windows XP Professional Python 2.6.6 (r266:84297, Aug 24 2010, 18:46:32) [MSC v.1500 32 bit (Intel)] Python 2.7 (r27:82525, Jul 4 2010, 09:01:59) [MSC v.1500 32 bit (Intel)] Python 3.1.2 (r312:79149, Mar 21 2010, 00:41:52) [MSC v.1500 32 bit (Intel)] Unfortunately I cannot test the original program I had the problem with, because since the original post (2006) I changed the employer. Now I use Matlab :( |
Ok, I'm closing this as "won't fix". The OP doesn't have the issue anymore; anybody else having some issue please report that separately (taking into account that you are likely asked to provide a patch as well). |
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: