@support.skip_if_pgo_task
@bigmemtest(size=(_4G + 100), memuse=2)
def testCompress4G(self, size):
    bz2c = BZ2Compressor()
    data = (b'x' * size)
    try:
        compressed = bz2c.compress(data)
        compressed += bz2c.flush()
    finally:
        data = None
    data = bz2.decompress(compressed)
    try:
        self.assertEqual(len(data), size)
        self.assertEqual(len(data.strip(b'x')), 0)
    finally:
        data = None
@support.skip_if_pgo_task
@bigmemtest(size=(_4G + 100), memuse=2)
def testCompress4G(self, size):
    bz2c = BZ2Compressor()
    data = (b'x' * size)
    try:
        compressed = bz2c.compress(data)
        compressed += bz2c.flush()
    finally:
        data = None
    data = bz2.decompress(compressed)
    try:
        self.assertEqual(len(data), size)
        self.assertEqual(len(data.strip(b'x')), 0)
    finally:
        data = None