Gases dissolved in molten metals are liberated when cooled giving rise to:
Both pinhole and gas inclusion porosities are related to the entrapment of gas during solidification. Both are characterized by a spherical contour but are decidedly different in size. 
The gas inclusion porosities are usually much larger than pinhole porosity. Many metals dissolve or occlude gases while they are molten. For example, both copper and silver dissolve oxygen in large amounts in the liquid state. Molten platinum and palladium have a strong affinity for hydrogen as well as oxygen. On solidification, the absorbed gases are expelled and pinhole porosity results. The larger voids may also result from the same cause, but it is more logical to assume that such voids are caused by gas that is mechanically trapped by the molten metal in the mold or by gas that is incorporated during the casting procedure.
Reference: PHILLIPS’ SCIENCE OF DENTAL MATERIALS, 12th ed page no 226
Suckback porosity
Gas inclusion porosity
Localized shrinkage porosity
Microporosity