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
{{ message }}
This repository has been archived by the owner on Mar 22, 2023. It is now read-only.
class transaction_out_of_memory : public transaction_alloc_error,
public std::bad_alloc {
All of those: transaction_alloc_error -> transaction_error -> std:runtime_error has constructor(const std::string&), but std::runtime_error not, it is designed to not take additional memory (hey, we have OOM, so we should be careful).
Second thing: throw new transaction_out_of_memory().with_pmemobj_errormsg(); will create 3 objects instead of 1 causing unnecessary object creation during OOM situation.
My point is to make this simply to use and add proper constructors like these in std::runtime_error. std::bad_alloc dosn't have it for known reason.
The text was updated successfully, but these errors were encountered:
What exactly do you propose? I don't think there is any problems with creating multiple objects (which most likely will be optimized anway anyway). And we don't need to be so careful about the memory usage since the OOM is from PMEM and std::string comes from dram.
Generally (comment taken from #1144):
All of those:
transaction_alloc_error -> transaction_error -> std:runtime_error
hasconstructor(const std::string&)
, but std::runtime_error not, it is designed to not take additional memory (hey, we have OOM, so we should be careful).Second thing:
throw new transaction_out_of_memory().with_pmemobj_errormsg();
will create 3 objects instead of 1 causing unnecessary object creation during OOM situation.My point is to make this simply to use and add proper constructors like these in std::runtime_error. std::bad_alloc dosn't have it for known reason.
The text was updated successfully, but these errors were encountered: