Understanding phonon transport at nanoscale is critically important for thermal nanometrology applications including scanning thermal microscopy, three-omega and time domain thermoreflectance experiments. In this paper, a multidimensional non-gray Monte Carlo simulation is developed to investigate the ballistic phonon transport in a silicon sample heated on the top by a small localized heater line. We observed that heat confinement occurs for very small heat sources. This result contradicts the classical Fourier model, according to which the heat penetration depth is always significant, even with small sources. The temperature fields inside the sample exhibit different penetration depths depending strongly on the heater line size. Maximum thermal resistance and a large interface temperature jump take place in the limit of very small heater width compared to the phonon mean free path due to the nonequilibrium and ballistic nature of phonon transport. Increasing the heater width leads to a decrease in the heat flux and temperature jump. In the limit of a very large heat source, the heat flux and temperature jump become independent of heat source size. In accordance with experimental investigations for the case of sapphire material (Siemens et al 2010 Nature Mat. 9 26–30), the thermal resistance of the silicon sample due to the localized heat source decreases and then tends to reach a plateau with increasing source size from tens of nanometers to micrometers. These results are important, not only for understanding the thermal transport in the sample during nanometrology experiments, but also for the design and manipulation of heat at nanoscale.