WinAsm Studio, The Assembly IDE - Free Downloads, Source Code
Articles
Programming Quick Start
32-bit Assembler is Easy
Porting Iczelion tutorials
What is FASM
Hard Drive Recovery
Wiring your own LAN
 
Forum
Pages (2) [1] 2   ( Go to first unread post )

Memory leak in EM_EMPTYUNDOBUFFER & HEM_RELOADFILE, I'm using the very nice HiEdit.dll control to monitor a file live - refresh the file when there are any changes.

tomte
Quote Post


New Member
*

Group: Members
Posts: 7
Member No.: 5797
Joined: 5-March 08


Sponsored Links
I'm using the very nice HiEdit.dll control to monitor a file live (- refresh the file when there are any changes.)

Have tried two ways of doing this but run into problems with both:

* Using RELOADFILE
A new copy of the file is created in %temp% on every reload, and old copies don't get deleted. Disk space keeps filling up.

* Using REPLACESEL
Tested loading the contents of the file and calling SETSEL + REPLACESEL to replace the current contents of the HiEdit control. When using this method memory usage keeps growing, which seems normal considering it is saving undo states.
However, even when calling EMPTYUNDOBUFFER after every REPLACESEL memory usage still keeps growing, until my program crash. I can see that the undo option is greyed out so HiEdit has cleared the states properly, however not the memory it seems?

Should I be calling any of the functions in a different way (or is there a smarter way to accomplish what I'm trying to do..?), or could this be a bug?

Many Thanks for your help,
PMEmail Poster
Top
akyprian
Quote Post


Administrator
******

Group: Admins
Posts: 2308
Member No.: 1
Joined: 12-May 04


Hi tomte,

Thanks a lot for your good words about HiEdit.

QUOTE
* Using RELOADFILE
A new copy of the file is created in %temp% on every reload, and old copies don't get deleted. Disk space keeps filling up.

You are probably right; I 'll have a look at the sources and see why the temp file is not deleted.


QUOTE
* Using REPLACESEL
Tested loading the contents of the file and calling SETSEL + REPLACESEL to replace the current contents of the HiEdit control. When using this method memory usage keeps growing, which seems normal considering it is saving undo states.
However, even when calling EMPTYUNDOBUFFER after every REPLACESEL memory usage still keeps growing, until my program crash. I can see that the undo option is greyed out so HiEdit has cleared the states properly, however not the memory it seems?

I 'll give this a look too and see if and why the memory is not released. If this is the case I 'll fix it.

All in all, I would use the RELOADFILE method which should be a lot faster and cleaner.

Thanks a lot for reporting these issues, I 'll let you know when I have some (hopefully good) news.

Antonis
PMEmail PosterUsers Website
Top
tomte
Quote Post


New Member
*

Group: Members
Posts: 7
Member No.: 5797
Joined: 5-March 08


Hi Antonis,

Many thanks for your quick reply.
I found SETTEXT was a bit cleaner than what I was doing with SETSEL + REPLACESEL (though it has the same memory behaviour). But as you say I'm sure RELOADFILE would be the best.

I hope you find the bug report useful, and many thanks again for this excellent control.

David
PMEmail Poster
Top
SeaFarer
Quote Post


Extremely Active Member
******

Group: Members
Posts: 1753
Member No.: 1464
Joined: 2-September 05


QUOTE (tomte @ Apr 23 2008, 07:32 AM)
I hope you find the bug report useful, and many thanks again for this excellent control.

Someone else that knows how to talk shop... thumbs_up.gif

Welcome aboard David! cheers.gif
PM
Top
akyprian
Quote Post


Administrator
******

Group: Admins
Posts: 2308
Member No.: 1
Joined: 12-May 04


Your bug report is wonderful, thanks once again. Never hesitate to ask / suggest anything.

cheers.gif
PMEmail PosterUsers Website
Top
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

Topic Options Pages (2) [1] 2  Reply to this topicStart new topicStart Poll

 

Sponsors
Computer Science

Internet
C/C++
Hardware & PC maintenance

HiEditor

General Discussions
Suggestions/Bug Reports
WinAsm Studio

General Discussions
Suggestions/Bug Reports
WinAsm Studio FAQ
Multilingual User Interface
Add-Ins
Assembly Programming

Main
Newbies
Projects
Custom Controls
Snippets
Announcements & Rules

Announcements

General

Online Degrees - Distance Learning
The Heap
Russian