Mmap problem with SharedArrays

Hello, I am confronting a very weird problem when parallelizing some function. I understand that I am supposed to post a MWE but I could not recreate the issue in a simple problem.

@everywhere function simulSample(Profits,ν,J,TerminalT,RelevantT,N,S,params,thresh;RelevantPer=RelevantPeriod)
    Dₑ = rand([0],J,1) # Final Condition
    Dᵢ = rand([0],J,1) # Initial Condition
    @inbounds @sync @distributed for n=1:S*N
    #for n=1:N
    return tempData

This function is being called by another function in an iterative procedure. In the first iteration it works, but in the second iteration I get the following error

SystemError: mmap the operation completed successfully

Some extra information might be useful. The time it runs in the first iteration, the @time provides the following information

334.405107 seconds (963.79 M allocations: 50.295 GiB, 3.64% gc time)

and the SharedArray tempData is of dimensions (47,11,17040)

any suggestion regarding this problem? It seems to me that there might be some memory problem. I tried to define the SharedArray in a local scope so that it deletes with each iteration but it seems to me that something might not be garbage collected.