From ff82e5e42ed5c3470d17af6710f24623dffd36ed Mon Sep 17 00:00:00 2001 From: Adam Palay Date: Mon, 27 Apr 2015 13:21:06 -0400 Subject: [PATCH 1/2] do garbage collection when dumping memory --- openedx/core/operations.py | 23 +++++++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) diff --git a/openedx/core/operations.py b/openedx/core/operations.py index 8f25868a13..8b3b1cf24c 100644 --- a/openedx/core/operations.py +++ b/openedx/core/operations.py @@ -1,14 +1,33 @@ import os import signal import tempfile +import gc from datetime import datetime from meliae import scanner def dump_memory(signum, frame): - """Dump memory stats for the current process to a temp directory. Uses the meliae output format.""" - scanner.dump_all_objects('{}/meliae.{}.{}.dump'.format(tempfile.gettempdir(), datetime.now().isoformat(), os.getpid())) + """ + Dump memory stats for the current process to a temp directory. + Uses the meliae output format. + """ + + timestamp = datetime.now().isoformat() + format_str = '{}/meliae.{}.{}.{{}}.dump'.format( + tempfile.gettempdir(), + timestamp, + os.getpid(), + ) + + scanner.dump_all_objects(format_str.format('pre-gc')) + + # force garbarge collection + for gen in xrange(3): + gc.collect(gen) + scanner.dump_all_objects( + format_str.format("gc-gen-{}".format(gen)) + ) def install_memory_dumper(dump_signal=signal.SIGPROF): From 41a66b521ba7bea9df972f56b91668f3afcdd6a8 Mon Sep 17 00:00:00 2001 From: Adam Palay Date: Wed, 29 Apr 2015 11:02:26 -0400 Subject: [PATCH 2/2] fix typo in captions js (TNL-2076) --- common/lib/xmodule/xmodule/js/src/video/00_sjson.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/common/lib/xmodule/xmodule/js/src/video/00_sjson.js b/common/lib/xmodule/xmodule/js/src/video/00_sjson.js index 6315f2d1e3..d5163d9a00 100644 --- a/common/lib/xmodule/xmodule/js/src/video/00_sjson.js +++ b/common/lib/xmodule/xmodule/js/src/video/00_sjson.js @@ -79,7 +79,7 @@ function() { var captions = getCaptions(); if (startTimes.length !== captions.length) { - throw new Exception("video caption and start time arrays do not match in length"); + console.warn("video caption and start time arrays do not match in length"); } // if end is null, then it's been set to