# Out of Memory Error And what is heap size?

**URL:** <https://forum.inductiveautomation.com/t/out-of-memory-error-and-what-is-heap-size/67923>\
**Category:** Ignition\
**Tags:** ignition81, vision\
**Created:** [December 22, 2022, 11:56am UTC](https://forum.inductiveautomation.com/t/out-of-memory-error-and-what-is-heap-size/67923 "2022-12-22T11:56:43Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![kyungjun\_kim](https://avatars.discourse-cdn.com/v4/letter/k/9de053/32.png) [@kyungjun\_kim](https://forum.inductiveautomation.com/u/kyungjun_kim)\
**Post date:** [December 22, 2022, 11:56am UTC](https://forum.inductiveautomation.com/t/out-of-memory-error-and-what-is-heap-size/67923/1 "2022-12-22T11:56:43Z")

</div>

Hello.  
While I was using the VISION project and doing CSV export, Out of Memory occurred.  
(Data exports one day's worth of data every second.)  
I changed heap size it to 8192M through Designer Launcher -\> Manage, but the same error occurs when I run the project in the designer.  
And, Out of Memory does not occur in the client launcher(heap size of Client launcher is only 512M).

Why does Out of Memory occur in the designer launcher and not in the client launcher?  
Also, I know that you can set the heap size for each launcher and also set the heap size in the Ignition.config file in the server gateway. What is the difference between each?

Thank you

---

<div class="post-metadata">

**Author:** ![paul-griffith](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/paul-griffith/32/37249_2.png) [@paul-griffith](https://forum.inductiveautomation.com/u/paul-griffith)\
**Post date:** [December 22, 2022, 5:00pm UTC](https://forum.inductiveautomation.com/t/out-of-memory-error-and-what-is-heap-size/67923/3 "2022-12-22T17:00:37Z")

</div>

> [@kyungjun\_kim](#):
>
> Why does Out of Memory occur in the designer launcher and not in the client launcher?

Hard to say without seeing your script. The designer has a lot more "going on" at once. Are you sure the script is returning exactly the same data in both scenarios, also?

> [@kyungjun\_kim](#):
>
> Also, I know that you can set the heap size for each launcher and also set the heap size in the Ignition.config file in the server gateway. What is the difference between each?

Exactly what it sounds like. Every Java process has a minimum and maximum heap allocation it's "allowed" to take. The gateway is one java process (JVM), and you can configure it's settings via `ignition.conf`. Each client or designer instance you launch is _also_ a JVM, and has its own minimum and maximum memory.

---

<div class="post-metadata">

**Author:** ![kyungjun\_kim](https://avatars.discourse-cdn.com/v4/letter/k/9de053/32.png) [@kyungjun\_kim](https://forum.inductiveautomation.com/u/kyungjun_kim)\
**Post date:** [December 22, 2022, 11:09pm UTC](https://forum.inductiveautomation.com/t/out-of-memory-error-and-what-is-heap-size/67923/4 "2022-12-22T23:09:04Z")

</div>

Thanks for the reply

1. The scripts are all the same and won't run when launched via f10 in the designer, but will run in the client launcher. The following is my script, and it extracts the daily value with data per second.  
(Use the CSV Export example almost as it is)

def browseHistoricalTags(tagList, path):  
for browseResult in system.tag.browseHistoricalTags(path).getResults():  
if browseResult.hasChildren():  
browseHistoricalTags(tagList, browseResult.getPath())  
else:  
tagList.append(browseResult.getPath())

historicalTagPathList =

historyProv = "DB\_TEST\_OPC\_KJ"  
gateway = "FCI-RMS"  
TagProv = "RTP\_TEST\_OPC\_KJK"

pathToBrowse = "histprov:" + historyProv + ":/drv:" + gateway + ":" + TagProv

browseHistoricalTags(historicalTagPathList, pathToBrowse)

tagPathList =

for tag in historicalTagPathList:  
tagPathList.append("[" + TagProv + "]" + str(tag).split("tag:")[1])

startDate = event.source.parent.getComponent('CSV Export').getComponent('CSV\_Calendar').date

systemDay = system.date.format(system.date.now(), "yyyyMMdd")  
startDay = system.date.format(startDate, "yyyyMMdd")  
if systemDay == startDay :  
endDate = system.date.now()  
elif systemDay \> startDay :  
endDate = system.date.addSeconds(startDate, 86399)

if system.date.now() \>= startDate:  
print "before query"  
resultSet = system.tag.queryTagHistory(paths = tagPathList  
, startDate = startDate  
, endDate = endDate  
, aggregationMode = "LastValue"  
, ignoreBadQuality = False  
, intervalSeconds = 1  
)

```
csv = system.dataset.toCSV(dataset = resultSet
                 , showHeaders = True
                 , forExport = False
                 , localized = False)

filename = system.date.format(startDate, "yyyyMMdd") + ".csv"
path = system.file.saveFile(filename)
if path is not None:
   system.file.writeFile(path, csv)

```

1. Does the heap allocated to Gateway mean the memory allocated by each client or designer?  
Then I don't understand what the meaning of the heap size set in the client is.  
Can I get a document that describes the meaning of the heap size set in the designer, client launcher, and gateway?
