Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
E
edx-platform
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
edx
edx-platform
Commits
f740bdbe
Commit
f740bdbe
authored
Apr 29, 2015
by
Adam
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #7853 from edx/hotfix/2015-04-29
do garbage collection when dumping memory
parents
6167b03e
41a66b52
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
22 additions
and
3 deletions
+22
-3
common/lib/xmodule/xmodule/js/src/video/00_sjson.js
+1
-1
openedx/core/operations.py
+21
-2
No files found.
common/lib/xmodule/xmodule/js/src/video/00_sjson.js
View file @
f740bdbe
...
...
@@ -79,7 +79,7 @@ function() {
var
captions
=
getCaptions
();
if
(
startTimes
.
length
!==
captions
.
length
)
{
throw
new
Exceptio
n
(
"video caption and start time arrays do not match in length"
);
console
.
war
n
(
"video caption and start time arrays do not match in length"
);
}
// if end is null, then it's been set to
...
...
openedx/core/operations.py
View file @
f740bdbe
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
):
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment