Space complexity in polynomial calculus