setMaxEventPoolSize (Android SDK API)


NewRelic.setMaxEventPoolSize(int $maxSize)

Sets the maximum size of the event pool.


Agent version 5.0.0 or higher.


By default, mobile monitoring collects a maximum of 1,000 events per event harvest cycle, which is 600 seconds long by default. This method controls the maximum size of the event pool stored in the memory until the next harvest cycle. When the pool size limit is reached, the New Relic Android agent will begin sampling events, discarding some old and some new events, until the pool of events are transmitted with the next harvest cycle. This method lets you override the maximum size of that event pool.

  • The default value for the event harvest cycle is 600 seconds.

See also setMaxEventBufferTime(), which lets you change the length of the event harvest cycle.


Be aware that reporting a large number of events, or reporting events too frequently, may impact app performance.

For context on how to use this API, see Send custom attributes and events.






Required. Maximum size of event pool.

Return values

Returns true if it succeeds, or false if it doesn't.


Set maximum size of event pool to 1000

boolean poolSizeSet = NewRelic.setMaxEventPoolSize(1000);