Jaroslaw,
The fact that you get the error a couple of times and then the application works wih no problem could indicate that the memory is fragmented (there is memory available but not in a segment of the size that is needed). That is depending on the time that you ask the OS for memory it has a page with enough space or not. You may want to increase the size of the virtual memory, defragment your hard drive and restart the computer to see if this makes any difference.
Another thing that you can try is putting the panels in separate uir files and load them from those separate files; this way the size of the memory chunk needed will be smaller.
Hope this tips helps.
Regards,
Juan Carlos
N.I.