Solved

TCL Event Loop Memory Limiation

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

Expert Comment

by:sarabande
Comment Utility
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
Comment Utility
Thank you guys.
We found the problem in a totally different place.
0
 

Author Closing Comment

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

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

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…
It is a general practice to get rid of old user profiles on a computer  in a LAN environment. As I have been working with a company in a LAN environment where users move from one place to some other place at times. This will make many user profil…
The viewer will learn how to clear a vector as well as how to detect empty vectors in C++.
In this fourth video of the Xpdf series, we discuss and demonstrate the PDFinfo utility, which retrieves the contents of a PDF's Info Dictionary, as well as some other information, including the page count. We show how to isolate the page count in a…

771 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

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now