viewpoint-particle

Author Topic: 3097: Out of memory for Variables  (Read 521 times)

JTaylor

  • Pundit
  • *****
  • Posts: 1948
    • Data & Stuff Inc.
3097: Out of memory for Variables
« on: November 07, 2023, 12:23:19 pm »
Any suggestions for resolving this error?   Had someone reinstall an app on an new machine and they now encounter this error.   Running on Win10.  They were running fine on a previous machine and others are running the same app fine.   Runs fine for me locally.   Haven't encountered this in a long while.

Thanks.

Jim

kdmoyers

  • Pundit
  • *****
  • Posts: 513
Re: 3097: Out of memory for Variables
« Reply #1 on: November 07, 2023, 01:21:17 pm »
I once had a bug in some substitution code that was on the left side of the assignment statement (a real risky move, I know), inside a loop, and got this error because I was, in effect, making hundreds of variables.  But that's the only time I've seen it.
(don't use substitution kids)
The mind is everything; What you think, you become.

JTaylor

  • Pundit
  • *****
  • Posts: 1948
    • Data & Stuff Inc.
Re: 3097: Out of memory for Variables
« Reply #2 on: November 07, 2023, 01:36:03 pm »
Will take a look on that front.  Just odd this is the only machine encountering the issue.    They are supposed to get the original database by tomorrow and replace the default one so will see what happens at that point.

Thanks for the reply.

Jim

td

  • Tech Support
  • *****
  • Posts: 4444
    • WinBatch
Re: 3097: Out of memory for Variables
« Reply #3 on: November 07, 2023, 01:49:34 pm »
There are no magical quick and easy solutions that I am aware of. You are getting the error because your script is defining more than 65000 variables or because someone has set a number considerably lower than that in the WWW-PROD.INI file. I would guess that the latter is very unlikely. Either way, you have a flawed assumption in your script. Since you can not reproduce the problem, you will need to resort to the tried-and-true debugging method - code inspection. There are some obvious areas to look at. For example, places where variables are created in loop control structures and places where you use substitution in loops.

Good luck.
"No one who sees a peregrine falcon fly can ever forget the beauty and thrill of that flight."
  - Dr. Tom Cade

JTaylor

  • Pundit
  • *****
  • Posts: 1948
    • Data & Stuff Inc.
Re: 3097: Out of memory for Variables
« Reply #4 on: November 07, 2023, 02:58:03 pm »
That was my thinking too but thought I would throw it out here and see if someone had any other ideas I hadn't considered.  Thanks.

Jim

ChuckC

  • Sr. Member
  • ****
  • Posts: 435
Re: 3097: Out of memory for Variables
« Reply #5 on: November 08, 2023, 06:46:01 am »
It may be helpful to utilize IntControl 77 in your script to dump out current variable usage such as total memory allocated for strings, total number of variables assigned, number of variable slots available, etc.

JTaylor

  • Pundit
  • *****
  • Posts: 1948
    • Data & Stuff Inc.
Re: 3097: Out of memory for Variables
« Reply #6 on: November 08, 2023, 07:47:20 am »
Yes.  Thank you.  That is a very useful function.  I used that a lot years ago when the variable limit was very low and had to constantly use Drop() and DropWild() throughout my program to keep it running.  Then I was able to use the Registry entries and then they made the limit the same and was able to drop that update.   Currently waiting for the database backup to see if that impacts the situation and that will help narrow down the focus, I hope.


Jim

td

  • Tech Support
  • *****
  • Posts: 4444
    • WinBatch
Re: 3097: Out of memory for Variables
« Reply #7 on: November 08, 2023, 08:24:47 am »
WinBatch only generates error 3097 when the maximum variable limit has been exceeded so string space is not an issue. Consider using IntControl 77 request codes 10, 11, and perhaps 72 if recursion is used in your script. You could post values to some form of storage at critical points in the scripts or something. Of course, it would require the cooperation of your user since you can't reproduce the problem.

<edit> If you are using an extender that automagically creates WIL variables, points in the script that call extender functions are worth an examination. </edit>
"No one who sees a peregrine falcon fly can ever forget the beauty and thrill of that flight."
  - Dr. Tom Cade

JTaylor

  • Pundit
  • *****
  • Posts: 1948
    • Data & Stuff Inc.
Re: 3097: Out of memory for Variables
« Reply #8 on: November 08, 2023, 09:44:13 am »
Yes.  I know where the problem most likely originates but not sure why for one machine.    I store a large number of settings for the application in a database.  Using substitution allows me to initialize these variables in a few lines of code rather than hundreds of lines.   Has never been an issue before so not sure what might be happening, assuming that is the issue.

I will report back once I figure it out in case it is useful to anyone else.

Thanks again.

Jim

JTaylor

  • Pundit
  • *****
  • Posts: 1948
    • Data & Stuff Inc.
Re: 3097: Out of memory for Variables
« Reply #9 on: November 09, 2023, 01:03:27 pm »
Turns out they had ignored some errors during install of the ODBC driver which cascaded into other issues.  Once I got their backup database and resolved other issues caused by the first thing and reinstalled the app everything worked.   Thanks for all the suggestions and sorry to have wasted your time.

Jim