Realloc error mesage


I’m receiving this error message: Fatal error: realloc: can’t allocate 536870912 bytes.
Is there any way around the error without sacrificing the simulation’s temporal resolution? My simulation time is 100ms and maximum time step is 10ns.

Edit > Preferences
If you disable “Fast (less accurate) Math” (i.e. to use Qspice80.exe), do you still get this fatal error? Never happen to me before. But as you mention resolution, worth a try.

The message error was generated with “Fast (less accurate) Math” disabled! If I enable it the 100ms simulation time is completed. However, doubling simulation time I get again the same identical message…

Fatal error: realloc: can’t allocate 536870912 bytes.

Curiously, the number of unallocated bytes is the same!

This is in hex. I doubt that this is a coincidence.

I don’t know what compiler QSpice is built with but I’m guessing that this is a maximum memory block allocation. If so, you’ll have to find some way to have QSpice need less memory.


This limitation could be quite annoying, There are several application examples that requires hundreds of milliseconds of simulation time or more. I will give two examples: AC grid connected inverter and microgrid with several distributed power generation units. I hope Mike could solve this particulary issue.

The more that I think about it… That’s much too small to be a maximum allocation. Mike must simply be allocating in round blocks.

You could try increasing the virtual memory setting. Here’s a reasonably clear explanation of how to get to the settings: How to manage virtual memory on windows 11 | Windows Central

You could also use the Resource Monitor and/or Task Manager to monitor memory.


Increasing the virtual memory size has no effect.

Well, before raising an issue with Mike, maybe you could post the schematic and we’ll see if others can reproduce the problem. (If it’s a memory leak truly exhausting memory, we should be able to reproduce.)


The schematic is simple.

can you upload this schematic and we can see anything can help?


inverter.qsch (29.5 KB)

Possibly delay consumed all memory. Change to release delay history format.
Change all delay function formula from delay(V(pwmb_inv),deadtime) to delay(V(pwmb_inv),deadtime,deadtime*2).
i.e. from delay(x,y) to delay(x,y,z)

1 Like

It works. Thank you Kevin.