Many DSP and image processing embedded systems have hard memory constraints which makes it difficult to find a good task assignment and scheduling which fulfill these constraints. This paper presents a new heuristic developed for task assignment and scheduling for such systems. These systems have also a large number of constraints of different nature, such as cost, execution time, memory capacity and limitations on resource usage. The heterogeneous constraints require new synthesis methods which will take them into account during searching for a valid solution. The heuristic presented in this paper is a part of the CLASS system (Constraint Logic Programming based System Synthesis).