Defect of compactness in spaces of bounded variation