Select to view content in your preferred language

MaxRecordCount on Feature Service

06-29-2023 05:55 AM
Occasional Contributor III

There is a service on our network that consists of multiple Feature Classes.
When I look at the root of the service it says MaxRecordCount 4000

But if I drill down into the individual Feature Classes in the Service each of the FC only have 1000

How do I change the individual ones?  Maybe someone update the main Service at some point to 4000 but this did not effect the individual FC in that service?

Maybe republish the whole thing again?

0 Kudos
4 Replies

Using the Admin REST API for each individual layer, call Update Definition with this input:

{"maxRecordCount": 4000}

 The easiest way to do this is through the Admin REST API's web interface, but you can use Python or whatever as well.

0 Kudos
New Contributor II

Thank you Jay for posting this! I was able to update it finally using the following steps. I will post it here in case other people run into the same situation.

Click the "view" button next to the URL in the item's overview page --> click "Admin" --> select one of the layer / table --> click "Update Definition" --> replace the maxrecordcount values

0 Kudos
New Contributor II

Some screenshots!

  1. Click "view" next to the URL in the item's overview page.


  1. Click "Admin" (top right corner)


  1. Select one of the layers


  1. Click "Update Definition" (at the very bottom)


  1.  Replace all the Max record count values, and click "update layer definition".


0 Kudos
Esri Contributor

To any Enterprise admins reading, please be mindful of enabling a high maxRecordCount due to memory exhaustion. 

Each ArcGIS Server instance (ArcSOC.exe) has a default heap value of 64MB - if the maxRecordCount of e.g. 4000 returns a JSON string that is higher than 64MB, it will crash the service/fail the request.


In some instances of complex data, it may be necessary to set a low maxRecordCount due to the records/features containing so much information (e.g. Complex geometry).

The default SOC heap size can be changed, but be careful when playing with memory 🙂

"We've boosted the Anti-Mass Spectrometer to 105 percent. Bit of a gamble, but we need the extra resolution."