# File size and readFileAsBytes function

**URL:** <https://forum.inductiveautomation.com/t/file-size-and-readfileasbytes-function/2747>\
**Category:** Ignition\
**Created:** [March 10, 2011, 5:07pm UTC](https://forum.inductiveautomation.com/t/file-size-and-readfileasbytes-function/2747 "2011-03-10T17:07:47Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![AlThePal](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/althepal/32/3603_2.png) [@AlThePal](https://forum.inductiveautomation.com/u/AlThePal)\
**Post date:** [March 10, 2011, 5:07pm UTC](https://forum.inductiveautomation.com/t/file-size-and-readfileasbytes-function/2747/1 "2011-03-10T17:07:47Z")

</div>

What size of file can readFileAsBytes cope with? We are using it to read in files which are then saved as BLOBs in a MySQL database. We have found that if the size of a file goes much beyond 5MB, the save starts and then (after maybe 15 seconds) the client suddenly shuts down without any warning.

The client initial memory limit is set to 32MB and the upper memory limit to 256MB. We are using Ignition 7.2.3. Are there any logs saved on the server or client which would help us pin down what is happening?

---

<div class="post-metadata">

**Author:** ![Travis.Cox](https://avatars.discourse-cdn.com/v4/letter/t/b9bd4f/32.png) [@Travis.Cox](https://forum.inductiveautomation.com/u/Travis.Cox)\
**Post date:** [March 10, 2011, 5:43pm UTC](https://forum.inductiveautomation.com/t/file-size-and-readfileasbytes-function/2747/2 "2011-03-10T17:43:19Z")

</div>

It probably has to do with the max packet size of MySQL. Check out this page:

[dev.mysql.com/doc/refman/5.5/en/ … large.html](http://dev.mysql.com/doc/refman/5.5/en/packet-too-large.html)

---

<div class="post-metadata">

**Author:** ![AlThePal](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/althepal/32/3603_2.png) [@AlThePal](https://forum.inductiveautomation.com/u/AlThePal)\
**Post date:** [March 10, 2011, 6:08pm UTC](https://forum.inductiveautomation.com/t/file-size-and-readfileasbytes-function/2747/3 "2011-03-10T18:08:42Z")

</div>

No, the max. packet size is set to 10MB.

---

<div class="post-metadata">

**Author:** ![Carl.Gould](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/carl.gould/32/7262_2.png) [@Carl.Gould](https://forum.inductiveautomation.com/u/Carl.Gould)\
**Post date:** [March 12, 2011, 5:58pm UTC](https://forum.inductiveautomation.com/t/file-size-and-readfileasbytes-function/2747/4 "2011-03-12T17:58:00Z")

</div>

Sounds like you’re running out of memory and Jython is exiting. readFileAsBytes doesn’t have any limits, but it does load the whole file into memory. Try upping your max memory for the client.
