Skip to content

Commit

Permalink
Enhance the CachingMemoryManager to possibly handle high memory press…
Browse files Browse the repository at this point in the history
…ure (#188)

Summary:
Enhance the CachingMemoryManager to handle high memory pressure by adding 2 options.
Note: the default behavior is unchanged.
Add a new API to MemoryManagerAdapter to setOption().
Side: remove some glog includes failing compilation if glog-dev not installed locally

**Original Issue**:
flashlight/flashlight#180
closes flashlight/flashlight#180

The CachingMemoryManager being greedy in memory. This PR adds 2 options to mitigate this.

### Test Plan (required)
Implemented a new unitest in order to show OOM with the default CachingMM and no OOM if the right option is set.

Pull Request resolved: flashlight/flashlight#188

Reviewed By: vineelpratap

Differential Revision: D24435873

Pulled By: jacobkahn

fbshipit-source-id: 99186439c1e306ad987079cc326ab68fe1f028fc
  • Loading branch information
WilliamTambellini authored and facebook-github-bot committed Oct 25, 2020
1 parent 99802f4 commit d13a718
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
6 changes: 3 additions & 3 deletions app/asr/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -87,9 +87,9 @@ add_executable(Train ${CMAKE_CURRENT_LIST_DIR}/Train.cpp)
add_executable(Test ${CMAKE_CURRENT_LIST_DIR}/Test.cpp)
add_executable(Decoder ${CMAKE_CURRENT_LIST_DIR}/Decode.cpp)

target_link_libraries(Train flashlight-app-asr)
target_link_libraries(Test flashlight-app-asr)
target_link_libraries(Decoder flashlight-app-asr)
target_link_libraries(Train flashlight-app-asr ${CMAKE_DL_LIBS})
target_link_libraries(Test flashlight-app-asr ${CMAKE_DL_LIBS})
target_link_libraries(Decoder flashlight-app-asr ${CMAKE_DL_LIBS})

# --------------------------- Tests ---------------------------

Expand Down
10 changes: 6 additions & 4 deletions ext/test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,13 @@ cmake_minimum_required(VERSION 3.5.1)
set(DIR ${CMAKE_CURRENT_LIST_DIR})
set(LIBS flashlight)

build_test(
${DIR}/common/SequentialBuilderTest.cpp
${LIBS}
"ARCHDIR=\"${DIR}/common/\""
if(FL_BUILD_CONTRIB)
build_test(
${DIR}/common/SequentialBuilderTest.cpp
${LIBS}
"ARCHDIR=\"${DIR}/common/\""
)
endif()

add_library(test_module_plugin MODULE
${DIR}/common/test_module_plugin.cpp)
Expand Down

0 comments on commit d13a718

Please sign in to comment.