You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@nekipelov@elnull use redisclient pubsub to publish message, but when i publish message 5000000, one message 290 Bytes, it will occur 2G memory leak above. top command show 2G memory that is not free, but it is no memory leak when i use gperftools or valgrind to check memory leak. code is below :
@nekipelov @elnull use redisclient pubsub to publish message, but when i publish message 5000000, one message 290 Bytes, it will occur 2G memory leak above. top command show 2G memory that is not free, but it is no memory leak when i use gperftools or valgrind to check memory leak. code is below :
#include
#include
#include
#include <boost/asio/ip/address.hpp>
#include <boost/format.hpp>
#include <boost/asio/deadline_timer.hpp>
#include <redisclient/redisasyncclient.h>
#include <gperftools/heap-profiler.h>
static const std::string channelName = "test_msg";
static const boost::posix_time::seconds timeout(1);
static std::atomic_int unique_send(0);
static std::atomic_int unique_cb_succ(0);
static std::atomic_int unique_cb_fail(0);
static std::atomic_int unique_pub_err(0);
class Client
{
public:
Client(boost::asio::io_service &ioService)
: ioService(ioService), publisher(ioService)
{
boost::asio::ip::address address = boost::asio::ip::address::from_string("127.0.0.1");
const unsigned short port = 6379;
boost::asio::ip::tcp::endpoint endpoint(address, port);
private:
boost::asio::io_service &ioService;
redisclient::RedisAsyncClient publisher;
};
int main(int argc, char ** argv)
{
if (argc < 1) {
std::cout << "usage error, please use like below : " << std::endl;
std::cout << "async_pubsub3 loop_count" << std::endl;
return -1;
}
}
The text was updated successfully, but these errors were encountered: