A definition of P indeed does not require a restriction on memory use. But the definition implies a restriction on memory: a polynomially bounded (in time) machine cannot use exponential memory (because reading 2^n cells on a tape requires 2^n time steps).