you are using too many upvalues so lua doesn't have enough space to store them all (limit of the language not your memory)
I would consider attaching all your infrequently used values/references to one or more tables.
For example make a table and add all frames you create to this
Code:
local myFrames = {} -- all frames go here :)
myFrames.Frame1 = CreateFrame(...)
myFrames.Frame2 = CreateFrame(...)
myFrames.Frame3 = CreateFrame(...)