And, generally, how can I check, if perl caught a signal on memory allocating?
Generally, I think you're onto a loser here. Trying to make unsafe signals work is not easy, which is is why perl itself abandoned them about 10 years ago.
Normal perl builds use the OS's malloc() library, since its is likely to be superior to perl's own implementaion. You could of course build a perl with perl's malloc by using the -Dusemymalloc on the Configure commnand line, then you'd have a perl with a lockable malloc and rubbish performance.
Even then, you would still be able to do almost nothing in your signal handler, because just about anything you tried to do (apart now from malloc) would be unsafe.
Dave.