Hello all, I try to build an array[AtomicBoolean] and meet a problem that: there is an "Segmentation fault" error when the size of the array is 500M,. The test code is below that I try to build the array with size N and initialize each element as "true" .
import x10.util.concurrent.AtomicBoolean; public class test { public static def main(args: Array[String]) { val n=Int.parse(args(0)); val N=Math.pow(2,n) as Int; Console.OUT.println(N); var c:Array[AtomicBoolean]=new Array[AtomicBoolean](N); for(i in 0..(N-1)){ c(i)=new AtomicBoolean(true); } Console.OUT.println(n+" has done"); } } I try the input n with 25,26,27,28,29,30. And the test results are below. It shows that 25,26,27,28 work well, but meet the "Segmentation fault" when trying with 29. I empty the cache and run 29 alone, but still meet the problem. And when I try with 30, I wait minutes and the program seems just hang there. This thing also happens with "AtomicInteger". The memory of my machine is 128GB, is there any comment about this? //ps: Though the method var c:Array[AtomicBoolean]=new Array[AtomicBoolean](N, new AtomicBoolean(true)) works, but that is not I want. 33554432 25 has done 67108864 26 has done 134217728 27 has done 268435456 28 has done 536870912 Segmentation fault Thanks a lot! Long ------------------------------------------------------------------------------ Introducing AppDynamics Lite, a free troubleshooting tool for Java/.NET Get 100% visibility into your production application - at no cost. Code-level diagnostics for performance bottlenecks with <2% overhead Download for free and get started troubleshooting in minutes. http://p.sf.net/sfu/appdyn_d2d_ap1 _______________________________________________ X10-users mailing list X10-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/x10-users