Python Forum
Program exits with error, but can't discover which
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Program exits with error, but can't discover which
#1
Hello everyone,

I have written a program in python that calculates the gravitational force of 2 objects on eachother. To do this I divide the object in a lot of smaller point masses. I thus need a very large list of objects. For some reason I can't figure out, my program crashes when I use too many objects. However, I don't get any error messages except for 'exited with non zero status'. I tried explicitly catching errors in my code, but I get no message whatsoever. The program simply shuts down.

Then I thought maybe my program was using too much memory, so I tried to check for memory usage.  The program crashes when a little over 2% of the total available memory is used... Those are about 600.000 objects using ~ 316 MB.

Right now I can't think of anything else that could cause this problem or how to find it. You can find the relevant part of my code on repl[dot]it/EwS1/555 (anti-spam won't let me post links yet)

The problem is caused by the calculateElements function of the HollowSphere class. The number of objects created is defined by N_r, N_phi and N_theta, the total  amount will be N_r * N_phi * N_theta.

Any ideas on how to tackle this problem are greatly appreciated!

BTW: the program works just fine when I use fewer objects.
Reply


Messages In This Thread
Program exits with error, but can't discover which - by MTVDNA - Jul-17-2017, 04:01 PM

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020