This post is from a suggested group
Hi
I tried to run a straightforward geometry of layered Gold(20nm)/Alumina(140nm)/Gold(20nm)/Glass(500nm) structures. I want to study the resonance of this cavity structure. I sweep over the wavelengths(400nm to 1000nm). But I got the following message: The requested 128x128x76000 (18.6GB) array exceeds the maximum array size preference (13.8GB). This might cause MATLAB to become unresponsive. Do you have some suggestions for me?
Hi Sudhir,
Thanks for your question. There could be two ways to go about solving this:
Assuming you have enough RAM (>> the 18.6 GB array you are trying to create), the issue could be the maximum array size limitations in MATLAB. You could try increasing this limit following the solution in one of these links: 1, 2, 3
If you do not have enough RAM, defining such a large problem won’t be possible without some tricks. In this case, could you confirm a few things for us? a. Whether setting the flag opt.usemex=True solves your problem (or if there is any difference at all), since it handles the memory a bit better b. What boundary widths do you use? Setting boundary_widths=2*wavelength could save some memory c. The array size is considerably large, and understandably so, since you need to sample at a very high rate to resolve the thin gold layer. Could you confirm what PPW value you use? If the above approaches don’t work, it seems the only way to fit the problem on your system would be by reducing its size (either by reducing the PPW as far as possible or even shrinking some of the layers if that is feasible)
We look forward to hearing from you. Hopefully, one of these suggestions helps, but let us know either way!