When you create a new task, the cron calls the job_add ( job.c ) function, this function allocates memory to the task and adds it to the tail of the task list. Work is distributed on the heap, so theoretically you are limited only by the RAM installed on your computer.
Some notes from the CRON code:
Task structure:
typedef struct _job { struct _job *next; entry *e; user *u; } job;
Each crontab user entry is identified by:
typedef struct _entry { struct _entry *next; uid_t uid; gid_t gid; char **envp; char *cmd; bitstr_t bit_decl(minute, MINUTE_COUNT); bitstr_t bit_decl(hour, HOUR_COUNT); bitstr_t bit_decl(dom, DOM_COUNT); bitstr_t bit_decl(month, MONTH_COUNT); bitstr_t bit_decl(dow, DOW_COUNT); int flags; #define DOM_STAR 0x01 #define DOW_STAR 0x02 #define WHEN_REBOOT 0x04 } entry;
And user structure:
typedef struct _user { struct _user *next, *prev; char *name; time_t mtime; entry *crontab; } user;
You can see that these structures do not require much memory. If you're curious about how the cron implementation works, you can see the code here: cron ubuntu source .
source share