A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://arduinojson.org/v6/api/jsonarray/memoryusage/ below:

JsonArray::memoryUsage() | ArduinoJson 6

Description

JsonArray::memoryUsage() returns the number of bytes used by the array pointed by the JsonArray.

Unlike JsonDocument::memoryUsage(), the result doesn’t include leaked memory.

Signature
size_t memoryUsage() const;
Example
char json[] = "[1,2,3]";
StaticJsonDocument<200> doc;
deserializeJson(doc, json);

JsonArray array = doc.as<JsonArray>();
array.remove(2); // remove last element to show the effect of a leak

Serial.println(array.memoryUsage());  // 16 on AVR
Serial.println(doc.memoryUsage());    // 24 on AVR
See also
  1. Home
  2. Version 6
  3. API
  4. JsonArray
  5. memoryUsage()

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4