An image forming apparatus includes a storage area used as a work area of
programs for implementing functions, the programs including a basic
function program configured to implement a basic function and an
extension function program configured to implement an extension function,
wherein the entire storage area is used in the event that the basic
function program is executed to implement a specified maximum function of
the basic function; a detecting unit configured to detect a usage state
of the storage area; a storage unit configured to store information
indicating an allocation mode defining a method of allocating the work
area to the programs; and an allocation unit configured to allocate the
work area to each of the programs that is to be executed, according to
the usage state of the storage area detected by the detecting unit and
the allocation mode stored in the storage unit.