Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion src/backend/common/DefaultMemoryManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,8 @@ void *DefaultMemoryManager::alloc(bool user_lock, const unsigned ndims,
if (!this->debug_mode) {
// FIXME: Add better checks for garbage collection
// Perhaps look at total memory available as a metric
if (getMemoryPressure() > getMemoryPressureThreshold()) {
if (current.lock_bytes >= current.max_bytes ||
current.total_buffers >= this->max_buffers) {
this->signalMemoryCleanup();
}

Expand Down
3 changes: 2 additions & 1 deletion src/backend/cpu/queue.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,8 @@ class queue {
#ifndef NDEBUG
sync();
#else
if (getMemoryPressure() > getMemoryPressureThreshold() || count >= 25) {
if (getMemoryPressure() >= getMemoryPressureThreshold() ||
count >= 25) {
sync();
}
#endif
Expand Down
2 changes: 1 addition & 1 deletion src/backend/cuda/Array.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,7 @@ kJITHeuristics passesJitHeuristics(Node *root_node) {
// A lightweight check based on the height of the node. This is an
// inexpensive operation and does not traverse the JIT tree.
if (root_node->getHeight() > 6 ||
getMemoryPressure() > getMemoryPressureThreshold()) {
getMemoryPressure() >= getMemoryPressureThreshold()) {
// The size of the parameters without any extra arguments from the
// JIT tree. This includes one output Param object and 4 integers.
constexpr size_t base_param_size =
Expand Down
2 changes: 1 addition & 1 deletion src/backend/opencl/Array.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -296,7 +296,7 @@ kJITHeuristics passesJitHeuristics(Node *root_node) {
return kJITHeuristics::TreeHeight;
}

bool isBufferLimit = getMemoryPressure() > getMemoryPressureThreshold();
bool isBufferLimit = getMemoryPressure() >= getMemoryPressureThreshold();
auto platform = getActivePlatform();

// The Apple platform can have the nvidia card or the AMD card
Expand Down