1

I am using UJMP matrix package for my research work. I try to add a normal matrix with sparse matrix as per my research requirement.

Matrix Bigomega = Matrix.Factory.zeros(31037, 31037);
    Matrix omega = SparseMatrix.Factory.zeros(31037, 31037);

 //some code block

Bigomega = Bigomega.plus(omega);

I got this error:

Exception in thread "main" java.lang.OutOfMemoryError: Java heap space at org.ujmp.core.doublematrix.impl.DefaultDenseDoubleMatrix2D.(DefaultDenseDoubleMatrix2D.java:64) at org.ujmp.core.doublematrix.factory.DefaultDenseDoubleMatrix2DFactory.zeros(DefaultDenseDoubleMatrix2DFactory.java:34) at org.ujmp.core.doublematrix.factory.DefaultDenseDoubleMatrix2DFactory.zeros(DefaultDenseDoubleMatrix2DFactory.java:30) at org.ujmp.core.doublematrix.stub.AbstractDenseDoubleMatrix2D.plus(AbstractDenseDoubleMatrix2D.java:121) at Part1ujmp.main(Part1ujmp.java:66)

Can any one answer me what is the maximum dimension a UJMP matrix can held?

I think this error came because I don't have sufficient memory space.

Can any one specifically discuss about this error. why it is came and is there any way to get rid of it?

Thanks is advance

Saswati
  • 192
  • 8
  • 1
    Probably going to need a lot more memory than you have to do that calculation. After calculation, it looks like you've got 1926590738 cells between the two matrices. Assuming each entry is 8 bytes (They might be more), that's close to 16GB for just the two structures. – Christopher Schneider Aug 29 '18 at 21:44
  • @shash678 can you explain it some example? I cannot get your point. – Saswati Aug 29 '18 at 23:19
  • Run your program from the command line or the options in your ide so that it uses more ram (memory), `-Xmx16g means you are specifying the maximum size, in bytes, of the memory allocation pool to 16gb. – Sash Sinha Aug 29 '18 at 23:20
  • @ChristopherSchneider So what will be the solution? Is there any other data structure in java to complete the operation? – Saswati Aug 29 '18 at 23:20
  • @shash678 ok Got it. – Saswati Aug 29 '18 at 23:20
  • If I want GPU computation how could I compute that?What are the procedure to compute using GPU? – Saswati Aug 30 '18 at 12:16
  • @Saswati I would imagine you'd need to do your calculation in pieces, not all at once, if you're limited on your hardware. You could also just get more memory. 32GB would be a safe amount just judging from the code you supplied. Or you could lease some VMs with more memory from a cloud service, but that's probably going to be expensive. – Christopher Schneider Aug 30 '18 at 14:04

0 Answers0