# Parse error: "limit" in function

**URL:** <https://forum.kx.com/t/parse-error-limit-in-function/14032>\
**Category:** Community Support\
**Tags:** imported, kdb-and-q\
**Created:** [August 20, 2024, 4:37pm UTC](https://forum.kx.com/t/parse-error-limit-in-function/14032 "2024-08-20T16:37:33Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![fav\_pa](https://sea2.discourse-cdn.com/flex002/user_avatar/forum.kx.com/fav_pa/32/128_2.png) [@fav\_pa](https://forum.kx.com/u/fav_pa)\
**Post date:** [August 20, 2024, 4:37pm UTC](https://forum.kx.com/t/parse-error-limit-in-function/14032/1 "2024-08-20T16:37:33Z")

</div>

[https://learninghub.kx.com/forums/topic/parse-error-limit-in-function](https://learninghub.kx.com/forums/topic/parse-error-limit-in-function)

Hello everyone,   
I am currently learning q/kdb and am writing a function to load and process data called .data.function  
it works well.   
but now, even if had a single line as print "hello", it triggers the error:

ERROR: limit

\>\>\> Explanation: Tried to generate a list longer than 240-1, or serialized object is \> 1TB, or 'type if trying to serialize a nested object which has \> 2 billion elements, or Parse errors, too many constants

I really dont understand why, especially because the code works fine when i run it line by line

Thank you for your help  
PF

---

<div class="post-metadata">

**Author:** ![pgyorok](https://sea2.discourse-cdn.com/flex002/user_avatar/forum.kx.com/pgyorok/32/128_2.png) [@pgyorok](https://forum.kx.com/u/pgyorok)\
**Post date:** [August 20, 2024, 4:47pm UTC](https://forum.kx.com/t/parse-error-limit-in-function/14032/2 "2024-08-20T16:47:25Z")

</div>

Without seeing your code, it is hard to determine what the problem is, but most likely you are reaching the limit on local variables, constants or global references in the function.

[Errors | Basics | kdb+ and q documentation - kdb+ and q documentation (kx.com)](https://code.kx.com/q/basics/errors/#parse-errors)

---

<div class="post-metadata">

**Author:** ![mahesh-chavan1997](https://sea2.discourse-cdn.com/flex002/user_avatar/forum.kx.com/mahesh-chavan1997/32/128_2.png) [@mahesh-chavan1997](https://forum.kx.com/u/mahesh-chavan1997)\
**Post date:** [September 2, 2024, 6:22am UTC](https://forum.kx.com/t/parse-error-limit-in-function/14032/3 "2024-09-02T06:22:28Z")

</div>

limit error usually occurs when you try to create a list greater than 2 Billion items or object with size greater than 2GB.

As you said you are loading and processing the data you can divide the data into chunks and then process it. It might help.
