Shape selectivity and carbon formation in zeolites