RoseGPE / RoseLapWeb

Laptime Simulation tool, special built for Formula SAE.
http://rosegpe.ddns.net/RoseLap/
16 stars 2 forks source link

Memory leak on big studies #39

Closed Thaddeus-Maximus closed 6 years ago

Thaddeus-Maximus commented 6 years ago

2018-07-16 20:31:54,520 | ERROR : Traceback (most recent call last): File "c:/wamp/www/RoseLap/py/RoseLapCore/webrunner.py", line 76, in results = batcher.batch(tests, vehicle, tracks, model, out[1] != 0) File "c:\wamp\www\RoseLap\py\RoseLapCore\batcher.py", line 21, in batch batch["track_data"] = batch_run(flatTargets, permutations, batch["test_vals"], vehicle, tracks, model, include_output) File "c:\wamp\www\RoseLap\py\RoseLapCore\batcher.py", line 173, in batch_run segments = track_segmentation.file_to_segments(fn, dl, opts=opts) File "c:\wamp\www\RoseLap\py\RoseLapCore\input_processing\track_segmentation.py", line 388, in file_to_segments pts,sectors = points_in_each_seg_slow(testpath, dl, plot, opts) File "c:\wamp\www\RoseLap\py\RoseLapCore\input_processing\track_segmentation.py", line 174, in points_in_each_seg_slow spl = UnivariateSpline(l, k, k=smoothing_dof) File "C:\Python27\lib\site-packages\scipy\interpolate\fitpack2.py", line 185, in init xb=bbox[0],xe=bbox[1],s=s) MemoryError Traceback (most recent call last): File "c:/wamp/www/RoseLap/py/RoseLapCore/webrunner.py", line 76, in results = batcher.batch(tests, vehicle, tracks, model, out[1] != 0) File "c:\wamp\www\RoseLap\py\RoseLapCore\batcher.py", line 21, in batch batch["track_data"] = batch_run(flatTargets, permutations, batch["test_vals"], vehicle, tracks, model, include_output) File "c:\wamp\www\RoseLap\py\RoseLapCore\batcher.py", line 173, in batch_run segments = track_segmentation.file_to_segments(fn, dl, opts=opts) File "c:\wamp\www\RoseLap\py\RoseLapCore\input_processing\track_segmentation.py", line 388, in file_to_segments pts,sectors = points_in_each_seg_slow(testpath, dl, plot, opts) File "c:\wamp\www\RoseLap\py\RoseLapCore\input_processing\track_segmentation.py", line 174, in points_in_each_seg_slow spl = UnivariateSpline(l, k, k=smoothing_dof) File "C:\Python27\lib\site-packages\scipy\interpolate\fitpack2.py", line 185, in init xb=bbox[0],xe=bbox[1],s=s) MemoryError

Thaddeus-Maximus commented 6 years ago

cant reproduce that, but it consistently fails on this, now:

2018-07-16 20:46:13,503 | ERROR : Traceback (most recent call last): File "c:/wamp/www/RoseLap/py/RoseLapCore/webrunner.py", line 76, in results = batcher.batch(tests, vehicle, tracks, model, out[1] != 0) File "c:\wamp\www\RoseLap\py\RoseLapCore\batcher.py", line 21, in batch batch["track_data"] = batch_run(flatTargets, permutations, batch["test_vals"], vehicle, tracks, model, include_output) File "c:\wamp\www\RoseLap\py\RoseLapCore\batcher.py", line 187, in batch_run thread_results = [run_permutation(d) for d in thread_data] File "c:\wamp\www\RoseLap\py\RoseLapCore\batcher.py", line 98, in run_permutation data = solver.steady_solve(prepped_vehicle, segments) if steady_state else solver.solve(prepped_vehicle, segments) File "c:\wamp\www\RoseLap\py\RoseLapCore\sims\sim_onetire.py", line 226, in solve precrash_output = np.zeros((len(segments), O_MATRIX_COLS)) MemoryError Traceback (most recent call last): File "c:/wamp/www/RoseLap/py/RoseLapCore/webrunner.py", line 76, in results = batcher.batch(tests, vehicle, tracks, model, out[1] != 0) File "c:\wamp\www\RoseLap\py\RoseLapCore\batcher.py", line 21, in batch batch["track_data"] = batch_run(flatTargets, permutations, batch["test_vals"], vehicle, tracks, model, include_output) File "c:\wamp\www\RoseLap\py\RoseLapCore\batcher.py", line 187, in batch_run thread_results = [run_permutation(d) for d in thread_data] File "c:\wamp\www\RoseLap\py\RoseLapCore\batcher.py", line 98, in run_permutation data = solver.steady_solve(prepped_vehicle, segments) if steady_state else solver.solve(prepped_vehicle, segments) File "c:\wamp\www\RoseLap\py\RoseLapCore\sims\sim_onetire.py", line 226, in solve precrash_output = np.zeros((len(segments), O_MATRIX_COLS)) MemoryError

Thaddeus-Maximus commented 6 years ago

Fixing this on branch fix_memory_leak. How? great question, right? I think we need to discard output matrices as soon as we're done with them. don't leave them around.

Thaddeus-Maximus commented 6 years ago

nope, there's something more fucked up going on than just keeping output matrices around