# Local count too large

**URL:** https://talk.remobjects.com/t/local-count-too-large/27768
**Category:** Oxygene
**Created:** [January 15, 2023, 10:43pm UTC](https://talk.remobjects.com/t/local-count-too-large/27768 "2023-01-15T22:43:04Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![tampatex](https://talk.remobjects.com/letter_avatar_proxy/v4/letter/t/4af34b/32.png) [@tampatex](https://talk.remobjects.com/u/tampatex)
#### Post date: [January 15, 2023, 10:43pm UTC](https://talk.remobjects.com/t/local-count-too-large/27768/1 "2023-01-15T22:43:04Z")

</div>

Uncaught (in promise) CompileError: WebAssembly.instantiate(): Compiling function #5837:“ms\_t16\_AIANFPA285\_1AIANFPA2858\_\_d\_cctor” failed: local count too large @+2670705

---

<div class="post-metadata">

### Author: ![mh](https://talk.remobjects.com/user_avatar/talk.remobjects.com/mh/32/18050_2.png) [@mh](https://talk.remobjects.com/u/mh)
#### Post date: [January 15, 2023, 10:45pm UTC](https://talk.remobjects.com/t/local-count-too-large/27768/2 "2023-01-15T22:45:27Z")

</div>

We’ll probably need a test case for this. do you have _a lot_ of locals?

---

<div class="post-metadata">

### Author: ![tampatex](https://talk.remobjects.com/letter_avatar_proxy/v4/letter/t/4af34b/32.png) [@tampatex](https://talk.remobjects.com/u/tampatex)
#### Post date: [January 15, 2023, 11:08pm UTC](https://talk.remobjects.com/t/local-count-too-large/27768/4 "2023-01-15T23:08:44Z")

</div>

Sorry, been programming long time but don’t know what “locals” are. I’ve added a new data file,  
DatCities.pas that has only constants, a list of 6 col indexes:  
xST = 0  
xCtiy = 1  
xCounty = 2  
. . .  
xCityY = 5

And 237 Cities:  
sZoneTMY : Array[0…nCities, xST…xCityY] of String = (. . .) ; (237 lines of 6col each of string data for each city.

& the data:

For now just adding the data. Nothing done with it yet. Compiles w/ success but gets “locals” error. Remove the file & runs like before.

Adding such Dat file of data is assumed Global data which can be used by several pas modules.

---

<div class="post-metadata">

### Author: ![tampatex](https://talk.remobjects.com/letter_avatar_proxy/v4/letter/t/4af34b/32.png) [@tampatex](https://talk.remobjects.com/u/tampatex)
#### Post date: [January 15, 2023, 11:24pm UTC](https://talk.remobjects.com/t/local-count-too-large/27768/5 "2023-01-15T23:24:40Z")

</div>

The application has 12,000 lines of source code in 25 pas files.

Perhaps normal or weird but the data files start with “Dat…”, e.g. DatCities.pas in this example. Some have only data & some have data with a few small supporting methods, like to get some data, etc. The program files follow the Dat.files by alphabetic name. Recently I added a Dat file not beginning with “Dat” & it alphabetically mixed with the Method-type.pas file & some methods could not find the Data until I preceded the file name with “Dat” putting it ahead of the Method-type.pas files. Then it found the data.

---

<div class="post-metadata">

### Author: ![tampatex](https://talk.remobjects.com/letter_avatar_proxy/v4/letter/t/4af34b/32.png) [@tampatex](https://talk.remobjects.com/u/tampatex)
#### Post date: [January 16, 2023, 12:16am UTC](https://talk.remobjects.com/t/local-count-too-large/27768/6 "2023-01-16T00:16:14Z")

</div>

Gets “locals” error with any more than 216 cities in the Cities Array. Must be a memory problem of some kind. Browser memory? Anything you know of I can do about it? There is a lot of data in the Ap & eventually there will be 1000 cities when it can’t handle 237 & there will be more data. Maybe I need to include only the necessary data & retrieve the rest from the Server when needed? Then it won’t be a self-contained Ap & any breakage in the link to the server will cause the Ap to not run. The Total WASM file is about 9MB.

Gotta quit for day, feed myself & daughter, watch TV, drink 2 beers & head to bed. Look forward to your reply tomorrow. --tex

---

<div class="post-metadata">

### Author: ![mh](https://talk.remobjects.com/user_avatar/talk.remobjects.com/mh/32/18050_2.png) [@mh](https://talk.remobjects.com/u/mh)
#### Post date: [January 16, 2023, 1:16pm UTC](https://talk.remobjects.com/t/local-count-too-large/27768/7 "2023-01-16T13:16:28Z")

</div>

> [@tampatex](#):
>
> Sorry, been programming long time but don’t know what “locals” are.

Local variables in a method. i could imagine from the error that maybe WebAssemly has some limit, if you have way too many.

Getting a full project that shows this would greatly help; i am traveling this week, and i could try reproduce this myself when i’m back in office later next week; but to log it for the compiler team now, i’d need a full test case.

thanx  
marc
