How to change GeoServer memory limits for Cross-layer filter in Linux?
As the page you link to says:
These limits can be overridden by setting alternate values for the following parameters (this can be done using JVM system variables, servlet context variables, or environment variables):
QUERY_LAYER_MAX_FEATURES controls the maximum number of features collected by queryCollection
GEOMETRY_COLLECT_MAX_COORDINATES controls the maximum number of coordinates collected by collectGeometries
So you can set a JVM variable by editing the startup script of your container manager (jetty or tomcat?) and looking for
JAVA_OPTS or you can set the servlet context variables by editing the
web.xml file or you can set the variables in your systems environment as normal.