There is a general trend of downscaling laser cavities, but with high integration and energy densities of nanocavity lasers, significant thermal issues affect their operation. The complexity of geometrical parameters and the various materials involved hinder the extraction of clear design guidelines and operation strategies. Here, we present a systematic thermal analysis of InP-on-Si micro-and nanocavity lasers based on steady-state and transient thermal simulations and experimental analysis. In particular, we investigate the use of metal cavities for improving the thermal properties of InP-on-Si micro-and nanocavity lasers. Heating of lasers is studied by using Raman thermometry and the results agree well with simulation results, both revealing a temperature reduction of hundreds of kelvins for the metal-clad cavity. Transient simulations are carried out to improve our understanding of the dynamic temperature variation under pulsed and continuous wave pumping conditions. The results show that the presence of a metal cladding not only increases the overall efficiency in heat dissipation but also causes a much faster temperature response. Together with optical experimental results under pulsed pumping, we conclude that a pulse width of 10 ns and a repetition rate of 100 kHz is the optimal pumping condition for a 2 μm wide square cavity.