# API Requests cause Crashing due to Large Memory Allocation

**URL:** <https://forum.inductiveautomation.com/t/api-requests-cause-crashing-due-to-large-memory-allocation/112646>\
**Category:** Ignition\
**Tags:** perspective, scripting\
**Created:** [December 5, 2025, 1:43pm UTC](https://forum.inductiveautomation.com/t/api-requests-cause-crashing-due-to-large-memory-allocation/112646 "2025-12-05T13:43:49Z")\
**Posts on this page:** 1\
**Showing post:** 6

<div class="post-metadata">

**Author:** ![francisco.salinas](https://avatars.discourse-cdn.com/v4/letter/f/ce73a5/32.png) [@francisco.salinas](https://forum.inductiveautomation.com/u/francisco.salinas)\
**Post date:** [December 9, 2025, 4:33pm UTC](https://forum.inductiveautomation.com/t/api-requests-cause-crashing-due-to-large-memory-allocation/112646/6 "2025-12-09T16:33:17Z")

</div>

Thank you everyone for the suggestions. This issue was resolved by using

```python
# set client = system.net.httpClient() somewhere outside of the function definition scope below

	url = payload["url"]
	headers = {
	    "Accept": "application/json;charset=UTF-8"
	}
	

	
	# Request with custom headers
	response = client.get(url, headers=headers)

```

I was using a `BufferedReader` and then a `system.util.jsonDecode("".join(content))` before.  
Both of these were causing significant memory issues instead of receiving the data as true JSON.

I also implemented the [following code.](https://forum.inductiveautomation.com/t/issues-when-using-system-util-invokeasynchronous-i-get-a-nonetype-object-is-not-callable-error/97022/12)

---

_[View the full topic](https://forum.inductiveautomation.com/t/api-requests-cause-crashing-due-to-large-memory-allocation/112646)._
