Computer Science Canada

Turing Memory Leak

Author:  SNIPERDUDE [ Thu Nov 04, 2010 5:19 pm ]
Post subject:  Turing Memory Leak

It's been a while since I actually asked a question myself in the Turing Help section, but I was wondering something:

When I was working on something I realized that when I test run it, and successfully finish the execution, Turing still bags up a bunch of memory. It just cumulates until I have to close Turing and re-open the project.

It's a fairly large project (roughly 4k lines), but what do you think causes this memory leak? Is it because it doesn't free pictures and/or variables when done?
Just curious, the program runs fine.

Author:  TerranceN [ Thu Nov 04, 2010 6:28 pm ]
Post subject:  RE:Turing Memory Leak

Well you can free pictures using Pic.Free, but when I tried a loop of loading a picture without freeing the picture, the memory was reclaimed when the application stopped running, so that is not the problem.

I can't think of a way that your program could have a memory leak that wouldn't be automatically cleaned up by the OS when the program stops execution (and I don't think you can even use unmanaged dynamic memory in a Turing program anyway). Maybe the problem is with the Turing IDE itself?

Author:  SNIPERDUDE [ Thu Nov 04, 2010 7:23 pm ]
Post subject:  RE:Turing Memory Leak

It is only in the IDE when I test run, this is not a compiled code problem. Though this could be an issue with the Turing (4.1) installation and/or OS (Windows 7).

Author:  Ultrahex [ Fri Nov 05, 2010 12:29 pm ]
Post subject:  Re: Turing Memory Leak

This was (and maybe still is) an ongoing and probably will never be fixed issue within what I believe is to be the IDE not cleaning after after running.

It was more prominent on school systems (at least when I was in highschool) due to their lack of RAM and often caused hanging issues or slow "RUN".

I am not sure what else to say except possible use another programming language or work on the compiler for Turing if so be.

Author:  SNIPERDUDE [ Fri Nov 05, 2010 1:17 pm ]
Post subject:  RE:Turing Memory Leak

Yea, it's not much of an issue, just something I noticed.
I'm only using Turing for this project because someone else started it, and in Turing.

I prefer Python any day.
Hmm, I wonder if I were to create a Turing interpreter in python? Or at the least a syntax converter...

Author:  mirhagk [ Fri Nov 05, 2010 2:02 pm ]
Post subject:  RE:Turing Memory Leak

lol everyone is wondering the same thing. After fooling around with making my own interpreted language, I decided to see if I could do it with Turing (language is very simple, add, subtracct, output etc..)

It actually shouldn't be too difficult so long as the code is correct, ie you write it in Turing, press F2 to space it, make sure it runs with no compile error, and then run it through a custom interpreter. Obviously not the best way to do it, but it's a start. I should hopefully have this be able to at least declare variables and output and assign them by monday. ( i have to work this weekend or else I could do a lot more)

Author:  Ultrahex [ Fri Nov 05, 2010 3:35 pm ]
Post subject:  Re: Turing Memory Leak

The turing language is actually a lot more complex then meets the eye, a lot of features are not documented which is part of the problem, also knowing how to write a proper compiler would be a better idea. There was at one point in time to figure out most if not all the syntax first as a grammar that we can plug into something such as sablecc then we can write a command line compiler that is cross platform. (see OpenT for details, plus various posts on this forum about it)

I am not sure if there is much if any interest in doing this anymore. There is always much talk about it but nothing ever seems to get done since it is overly complex. Especially when you get into drawing objects and co-ordinates and handling plugins etc...

Part of the problem is the amount of time students have, and also other priorities in life.

Author:  SNIPERDUDE [ Fri Nov 05, 2010 4:57 pm ]
Post subject:  RE:Turing Memory Leak

Making a mini, basic interpreted language sounds like a fun project though. Not much use, but interesting.


: