Solved

TCL Event Loop Memory Limiation

Posted on 2014-10-02
4
165 Views
Last Modified: 2014-10-17
Hi Experts,

What is the  limitation on the stack size associated with the TCL thread?
I'm facing a consistent problem with "allocation (malloc)" after some time of continuously running script.

I'm using the following initialization for the TCL framework:
	Tcl_FindExecutable(arg[0]);
	m_pTclInterp = Tcl_CreateInterp();
	Tcl_Preserve(m_pTclInterp);

Open in new window


Thanks.
0
Comment
Question by:Georges_Antoun
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
4 Comments
 
LVL 34

Expert Comment

by:sarabande
ID: 40363546
allocation with malloc is heap memory. if you have issues it normally is not the absolute heap-size which is violated but that the requested contiguous heap-space could not be provided.

to solve the problem you should try to allocate always moderately sized (say 4k) chunks of memory on the heap which are all freed before a new cycle begins in your code. doing so the heap memory would not get defragmented too much and freed memory could be used again. in your current code you may check the calls to TCL_Preserve whether the memory preserved always is released properly and that the sizes of the allocations would not permanently increase (for example by always doubling the sizes when a dynamic buffer was full).

Sara
0
 

Accepted Solution

by:
Georges_Antoun earned 0 total points
ID: 40375719
Thank you guys.
We found the problem in a totally different place.
0
 

Author Closing Comment

by:Georges_Antoun
ID: 40386235
The root cause of the problem reported was found somewhere else.
0

Featured Post

On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Article by: SunnyDark
This article's goal is to present you with an easy to use XML wrapper for C++ and also present some interesting techniques that you might use with MS C++. The reason I built this class is to ease the pain of using XML files with C++, since there is…
Batch, VBS, and scripts in general are incredibly useful for repetitive tasks.  Some tasks can take a while to complete and it can be annoying to check back only to discover that your script finished 5 minutes ago.  Some scripts may complete nearly …
The viewer will learn how to pass data into a function in C++. This is one step further in using functions. Instead of only printing text onto the console, the function will be able to perform calculations with argumentents given by the user.
Video by: Mark
This lesson goes over how to construct ordered and unordered lists and how to create hyperlinks.

734 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question