Some more observations:
The leak only appears to occur during client-side chunk loading; servers are fine, and RAM is steady while standing still.
Upgrading to LWJGL 3.3.0 does not fix it.
Persists in 1.18 Pre-release 2 and the latest version of OpenJDK.
Minecraft: 1.18 Pre-release 2
Java: OpenJDK 17 (17+35-Ubuntu-120.04)
The leak seems to disappear after switching to the X.Org nouveau driver (xserver-xorg-video-nouveau, "NV134 4.3 (Core Profile) Mesa 21.0.3").
From the profile, MC seems to be using a Direct3D 12 API with this driver, as opposed to OpenGL with the Nvidia driver.
[media]Attached a jemalloc memory allocation profile. The heavy use of _nv014glcore makes me suspicious of the graphics driver.
[media]MultiMC wrapper command for profiling:
sh -c "export LD_PRELOAD=/usr/local/lib/libjemalloc.so ; export MALLOC_CONF=prof:true,lg_prof_interval:30,lg_prof_sample:17,prof_prefix:/tmp/profiling/mc ; exec $INST_JAVA "$@""
I'm also getting this issue. Nice to know it's the world border, thanks for reporting. I'm using /worldborder set 29999984 as a workaround for now.
Also seems to affect /datapack enable.
This also appears to apply to zombies with CanPickUpLoot=true.
Unfortunately it still persists in 1.18-pre4.
Oddly: reloading chunks (pressing F3+A or changing render distance) seems to reset the leak. The leaked memory is not freed to the system, but the leaked pool does get re-used, so it takes a while to start visibly consuming memory again.