looping over mapped functions leads to "OUT_OF_MEM: ArBB Heap out of usage"

looping over mapped functions leads to "OUT_OF_MEM: ArBB Heap out of usage"

I have a standard c++ function that I wish to call repeatedly, with varying parameters, that in turn calls several arbb functions using arbb::call and arbb::map. It works for a while but eventually (after a couple of calls) leads to the
OUT_OF_MEM: ArBB Heap out of usage
error. Below is a greatly simplified version of the code that still gives me this error (using beta 1.4).



# include

using namespace arbb;
using namespace std;
typedef arbb::array UDT1;

#define norm 2.3
#define m1 999
#define a12 999
#define a13 728

// Calculate data main data
void mrg32k3aUnifFnc2(f32 & result, UDT1 & v) {

u64 p;
p = a12*v[1] + a13*(m1-v[0]);
p = p % m1;
v[0] = v[1]; v[1] = v[2]; v[2] = p;
result = norm * (f32)p;
void mrg32k3aFnc2Call(dense & Result, dense & VList) {

// initialise arrays
void setArray(UDT1 & v) {
v[0] = 2; v[1] = 2; v[2] = 2; v[3] = 2; v[4] = 2; v[5] = 2;
void setArrayCall(dense & v) {

void interleaved(int npts, int Dim) {

// result is the arbb object used to contain the data to be operated on
dense result(Dim);
dense VList(Dim);

// initialise arrays

// Calculate data main data
int loop = npts / Dim;
for (int i = 0; i < loop; i++) {

int main()
// Number of points to make
int npts = 1 << 25;
int Dim = 240000;

// Running in loop fail on the second time round the loop.
for (int i = 0; i < 4; i++) {
interleaved(npts, Dim);

return 0;

2 posts / 0 new
Last post
For more complete information about compiler optimizations, see our Optimization Notice.


Thanks for reporting this problem. It turns out to be a known problem of the current ArBB beta version. Sometimes, when an ArBB function is called many times (in your case it is called 138 times), memory consumption grows so high that it eventually crashes the ArBB runtime system. We have had a bug logged for the same problem. Hopefully, it will be addressed in our next release. There isn't a workaround for this problem at this time. I'll keep you updated once we make progress addressing this issue.


Leave a Comment

Please sign in to add a comment. Not a member? Join today