We show how techniques in machine-based complexity can be used to analyze the complexity of membrane computing systems. We focus on catalytic systems, communicating P systems, and systems with only symport/antiport rules, but our techniques are applicable to other P systems that are universal. We define space and time complexity measures and show hierarchies of complexity classes similar to well-known results concerning Turing machines and counter machines. We also show that the deterministic communicating P system simulating a deterministic counter machine in (Sosik (2002)) (Pre-Proc. of Workshop on Membrane Computing (WMC-CdeA2002), Curtea de Arges, Romania, 2002, pp. 371–382), (Sosik and Matysek (2002)) (Unconventional Models of Computation 2002, Lecture Notes in Computer Science, vol. 2509, Springer, Berlin, 2002, pp. 264–275.) can be constructed to have a fixed number of membranes, answering positively an open question in Sosik (2002), Sosik and Matysek (2002). We prove that reachability of extended configurations for symport/antiport systems (as well as for catalytic systems and communicating P systems) can be decided in nondeterministic log n space and, hence, in deterministic log 2 n space or in polynomial time, improving the main result in Paun et al. (2002) (On the reachability problem for P systems with symport/antiport, 2002, submitted for publication.). We propose two equivalent systems that define languages (instead of multisets of objects): the first is a catalytic system language generator and the other is a communicating P system acceptor (or a symport/antiport system acceptor). These devices are universal and therefore can also be analyzed with respect to space and time complexity. Finally, we give a characterization of semilinear languages in terms of a restricted form of catalytic system language generator.