Skip to content

Commit

Permalink
malloc_trim only on linux
Browse files Browse the repository at this point in the history
  • Loading branch information
CryptoForge committed Mar 10, 2020
1 parent 31d85ad commit 5cbeb98
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/wallet/wallet.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,9 @@
#include <boost/filesystem.hpp>
#include <boost/thread.hpp>

#ifdef __linux__ //linux only
#include <malloc.h>
#endif

using namespace std;
using namespace libzcash;
Expand Down Expand Up @@ -3069,9 +3071,11 @@ void CWallet::DeleteTransactions(std::vector<uint256> &removeTxs) {
return;
}
}

// Miodrag: release memory back to the OS

// Miodrag: release memory back to the OS, only works on linux
#ifdef __linux__
malloc_trim(0);
#endif
}

void CWallet::DeleteWalletTransactions(const CBlockIndex* pindex) {
Expand Down

0 comments on commit 5cbeb98

Please sign in to comment.