Is there a way of throttling a process resources, something akin to limits but for processes not users?

ie I want processX to be restricted in the amount of memory it can consume. For process cpu I guess I can simply nice the process, but total memory consumption is my primary concern.