Solved

TCL Event Loop Memory Limiation

Posted on 2014-10-02
4
159 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
  • 2
4 Comments
 
LVL 33

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

Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

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…
Active Directory replication delay is the cause to many problems.  Here is a super easy script to force Active Directory replication to all sites with by using an elevated PowerShell command prompt, and a tool to verify your changes.
The viewer will learn how to count occurrences of each item in an array.
The goal of the video will be to teach the user the difference and consequence of passing data by value vs passing data by reference in C++. An example of passing data by value as well as an example of passing data by reference will be be given. Bot…

810 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