Error: "The program must be terminated because of insufficient memory"


I am able to run the simulation and I think FDTD runs successfully. However based on simulation result when I use a built-in “generation group” in analysis group of FDTD to calculate Jsc, and other Generation related parameters, computer hangs during this calculations and return " bad allocation " or "“The program must be terminated because of insufficient memory” errors. I also tried using an “example file” just to be sure that the error is not on my side but I received the same error.

We have a computer which support 128 GB RAM and is a dell workstation. Can you please suggest some changes that I can make, I will be happy to share my simulation file with you, if wanted.




If you can run the simulation, and the message only appears when you run the analysis group to return the results. One possible reason is that the analysis requires a lot of memory. Can you try to download the solar_planar.fsp, and calculate the results of the analysis group? ( This example should be very simple and light, I dont expect it to require a lot of memory to finish the tasks.

If analysis group in your file does require a lot of memory, one thing you can do is to increase the “down sample x” (or y, z). That way, the calculation of the analysis group can be less memory intensive. The down sample option is in the Setup->Variables tab of the the analysis group.

Please give it a try, and reply this post to update us. Uploading your file here will also help us to understand the problem a little more.


Hi Chow

Thanks a lot for the reply. I am new to FDTD and it might be that I am doing something wrong in the simulation itself. Now I decreased mesh size for my simulation and now I am able to calculate the Jsc but it seems wrong. For Indium phosphide I am getting 33.1 A/m2 without using parametric sweep for polarization ? Is not it true that Jsc should be summation of both the polarization ? Can you please have a look at my simulation file to be sure that I am doing it right ?


I thought you may want to sum the Jsc and divide it by 2? At least, I think this is the way we had it in this example.

did you attach you file here?


Yeah I did. I am not sure, why its not showing. Yeah I cleared that out about Jsc, Thanks !

Single nanowire.fsp (410.6 KB)

Can you please check if what I am doing is alright ?



Looks like it should not require changing the polarization since your device looks symmetric to me. Also, I have added symmetric and anti-symmetrical boundary conditions (BC) to it so the simulation should run much faster now.

Few other points

  • You had the z min BC metal, I think you may want to try using PML first since metal is reflective, unless you are sure that no light will be able to pass through the InP layer.

  • I have reduce the mesh accuracy from 6 to 2. I think you might be at the stage to make sure you have some reasonable simulation settings, using fine mesh might reduce your productivity in this case.

Single nanowire.fsp (407.0 KB)

If you are learning our software, I would recommend you to watch these introductory videos below. There are very good videos to get you started and give you a bigger picture of what FDTD and solar cell simulations.


Thanks a lot for reply. I have been through these videos and links and many more and I really appreciate your advice. It’s just that I don’t feel confident enough to run these simulations on my own and I don’t have much guidance here.

Also, I was going through this link (Issues with simulation parameters) and it says that we should leave space between substrate and PML boundary if the substrate boundary is of wavelength range. It also suggest to use PML in the substrate but only if we are that no light will come out of substrate.

Can you explain, please ?


If you leave an empty space between the PML and substrate, you will allow interference happen in the substrate. Otherwise, no interference should be expected since PML will absorb light.

In your case, we have left some space the PML and substrate. This should be the safest setting, if you have a finite size substrate.


Thanks a lot ! Your previous reply was very helpful and my results looks understandable now. I really appreciate. I hope to mail you again if I find myself in any problem. Thanks a lot.



You are welcome, I hope you enjoy being part of the Lumerical Community!


Hi Chow
For the simulation file that you sent, let’s say I want to extend it to 10 periods and I want to see how electric field looks.

How can I do that ? I tried putting period in solar generation group and then running analysis but it does not seems to do anything.

Also I have a result that I am unable to interprete. In x-y axis my nanowire is at center i.e. (0,0). Then why is it that the absorption is lower in that region.


Hi Chow

I figured out the problem . Actually I was plotting y vs z vs E at x=0.3 micron ( period). When I plot it in visualizer I get to choose at what point of x-axis , do we want to plot electric field.

I wrote a program to plot Evs X but it always plots at X= 0.3 micron. I want it to plot at x=0. How can I do that. Below is attached program.



E_x= sqrt(E) ;
image(x1e6,y1e6,E_NW_X1,“x (micron)”,"|E|^2","|E| vs X");
exportfigure("|E| vs X");

Can you please help me write a program where I can plot it at a given point of x- or y- axis.


For some reason, I did not receive any notification on your replies.

I will take a look at your questions as soon as I can.


sorry for the late response, I have now turned on the notification (a watcher of the posts).

z0=0e-6; # set the z value of the slice
lam0=0.3e-6; # set the wavelength value of the slice


z_index = find(z,z0); # find the index
f_index = find(f,c/lam0); # find the index

E = sqrt(E2) ;
E_NW=pinch(E,4,f_index); # pick the slice for the frequency/wavelength you set
E_NW=pinch(E_NW,3,z_index); # pick the slice for the z0 you set
image(x1e6,y1e6,E_NW,“x (micron)”,“y (micron)”,"|E| vs xy");

now you can verify that using the visualizer to make sure you are picking the correct the lam0 and z0 in the script, see the screenshot below.


Thanks a lot . Now i undersrand the mistake. I was not using pinch command properly. Thanks a lot.




Thanks a lot.