Skip to content
This repository was archived by the owner on Sep 27, 2019. It is now read-only.

Commit 5b16e38

Browse files
authored
Merge pull request #1247 from saatviks/saatviks_tfmemleakfix
Tensorflow memory leak fix
2 parents 9799637 + 4382df2 commit 5b16e38

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

src/brain/tf_session_entity/tf_session_entity.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,11 @@ TFSE_TYPE::TfSessionEntity() {
3131

3232
TFSE_TEMPLATE_ARGUMENTS
3333
TFSE_TYPE::~TfSessionEntity() {
34-
TF_DeleteStatus(status_);
34+
TF_CloseSession(session_, status_);
35+
TF_DeleteSession(session_, status_);
3536
TF_DeleteGraph(graph_);
37+
TF_DeleteStatus(status_);
38+
TF_DeleteSessionOptions(session_options_);
3639
}
3740

3841
/*

test/leak_suppr.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,5 @@
33
# see #1194
44
#
55
leak:src_backend_utils_mmgr_mcxt.c
6+
# suppress the tensorflow background thread problem(#1232)
7+
leak:tf_session_entity.cpp

0 commit comments

Comments
 (0)