Solved

TCL Event Loop Memory Limiation

Posted on 2014-10-02
4
160 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

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

Question has a verified solution.

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

Templates For Beginners Or How To Encourage The Compiler To Work For You Introduction This tutorial is targeted at the reader who is, perhaps, familiar with the basics of C++ but would prefer a little slower introduction to the more ad…
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 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.
In this fifth video of the Xpdf series, we discuss and demonstrate the PDFdetach utility, which is able to list and, more importantly, extract attachments that are embedded in PDF files. It does this via a command line interface, making it suitable …

792 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