© 2018 authors. Published by the American Physical Society. Space-charge effects play an important role in high intensity particle accelerators and were studied using a variety of macroparticle tracking models. In this paper, we propose a symplectic particle-in-cell (PIC) model and compare this model with a recently published symplectic gridless particle model and a conventional nonsymplectic PIC model for long-term space-charge simulation of a coasting beam. Using the same step size and the same number of modes for the space-charge Poisson solver, all three models show qualitatively similar emittance growth evolutions and final phase space shapes in the benchmark examples. Quantitatively, the symplectic PIC and the symplectic gridless particle models agree with each other very well, while the nonsymplectic PIC model yields different emittance growth value. Using finer step size, the emittance growth from the nonsymplectic PIC converges towards that from the symplectic PIC model.