If yes,, this kind of fly wheels now using springs in them or dual mass types that makes the fluctuation of the engine which is transferring to the gearbox more smooth.
And also uses damper around springs which makes impacts and sudden accelerations in control.
Flywheel is used to store and release rotational energy, by applying torque to it increasing its rotational speed the energy is stored. By applying torque to the load, decreasing its rotational speed flywheel releases stored energy. For example in case of reciprocating engines torque is intermittent, here a flywheel helps in load equalization by storing and releasing the energy.
Flywheels are often used to provide continuous energy in systems where the energy source is not continuous. In such cases, the flywheel stores energy when torque is applied by the energy source, and it releases stored energy when the energy source is not applying torque to it. For example, a flywheel is used to maintain constant angular velocity of the crankshaft in a reciprocating engine. In this case, the flywheel—which is mounted on the crankshaft—stores energy when torque is exerted on it by a firing piston, and it releases energy to its mechanical loads when no piston is exerting torque on it
As explained by others, flywheel is used as an energy storage device. It stores excess momentum given to it by the power source and releases as required. See a comprehensive coverage in wiki
The purpose of adding a flywheel onto cranshaft is to reduce the speed irregularity, so that you have a smoother operating gear box and driveline attached to it, for higher durability and less noise and vibrations.
Different types of machines have different allowable levels of speed irregularity, which have to be attained by a proper design. Automotive engines have one of the strictest requirements in this sense.
It is clear, the bigger the cranshaft, the smoother is the operation. So why not to put a very large flywheel? Apart from the place restrictions, a bigger flywheel will cause: a) higher level of torsional loads in the cranshaft, b) the engine will become less responsive to the acceleration/decceleration control (i.e. while opening wider the throttle / while braking).
That's why there is often a compromise to be found.