Special accounting information

I need to figure out why did the system run out of memory and hung at a certain time. For further investigation, the info about every processes' CPU and memory consumption over time would be of high value.
I see, that Unix accounting may be of some help. But I'm not sure if I can get this particular info from it (memory consumption by certain process at a certain time).

After studying some docs on the acct daemon, and it's usage, it seems that it does not log the kind of information I need.

Is there any way to do that without writing the soft or script myself?

I know accounting a bit from the AIX side where it is used in our case to check which department used how much resources and is billed by that.
If you are going to sort out performance problems, you might want to start with vmstat, top, ps, iostat etc.
Maybe you check the net for nmon for example. There are different tools available.

What OS are you using?

System log analysis showed, that the free memory ended.
I know that the acct daemon provides SOME info, but not the one I need (how much memory the process consumed at a given time)
The OS is Linux (Debian Etch).

It's not that easy to see how much memory they are really using. Have a look at this excellent article to see why:

Virtual Threads: Understanding memory usage on Linux