MessageBadAlloc: report amount of available memory

This commit is contained in:
Alexey Rybalchenko 2020-08-06 09:50:56 +02:00
parent 9c27051cdc
commit b83655d5da

View File

@ -263,7 +263,7 @@ class Message final : public fair::mq::Message
} catch (boost::interprocess::bad_alloc& ba) { } catch (boost::interprocess::bad_alloc& ba) {
// LOG(warn) << "Shared memory full..."; // LOG(warn) << "Shared memory full...";
if (fManager.ThrowingOnBadAlloc()) { if (fManager.ThrowingOnBadAlloc()) {
throw MessageBadAlloc(tools::ToString("shmem: could not create a message of size ", size, ", alignment: ", (alignment != 0) ? std::to_string(alignment) : "default")); throw MessageBadAlloc(tools::ToString("shmem: could not create a message of size ", size, ", alignment: ", (alignment != 0) ? std::to_string(alignment) : "default", ", free memory: ", fManager.Segment().get_free_memory()));
} }
rateLimiter.maybe_sleep(); rateLimiter.maybe_sleep();
if (fManager.Interrupted()) { if (fManager.Interrupted()) {