remove max_events form replica loop, add memory measurement for the event data in preparation for a memory limit when writing a batch
remove max_events form replica loop, add memory measurement for the
event data in preparation for a memory limit when writing a batch

the4thdoctor/pg_chameleon,the4thdoctor/pg_chameleon