How system deamons consuming less memory

Dear all,
When I write the daemon programs it is consuming high memory and processor time. How can I avoid this?
But, the system daemons are not consuming more. How?
Can any one explain how the system daemons are handling the memory consumption and processor time.

Thanks,
Nagalenoj

Do you call sleep or usleep to shut down until a signal is received or the timeout of sleep is reached?

You can also use select or maybe poll for socket operations. daemons are "asleep" a large part of the time - sounds like yours is not.