Thickness of MgO which is an important parameter for applications in spin-transfer torque magnetic random access memory has effect to the temperature increase of a nanopillar. We investigated the temperature increment of a nanopillar due to the current injection for the current-induced magnetization switching. The thickness dependence of the nanopillar and temperature were obtained using a finite integral technique with the commercial simulation. The nanopillar temperature was found to be proportional to the thickness of MgO and the temperatures of free layer were similar to pinned layer when decrease thickness of MgO.