Highly Oscillating Boundaries and Reduction of Dimension: the Critical Case