I've created a program that will parse the log file generated by an MFP (Multi-Functional Printer). The program works fine when I parse a log file with less than 2000 lines, but when it reached more than 2000 lines (I've tried the log files with 8000 and 22000 lines), the program hangs and not responding, but it still do the task before it hangs.

Can someone have any idea why my program can't manipulate log files with more than 2000 lines?

Recommended Answers

All 6 Replies

Tricky without seeing the code. Is there something different about the line format after 2000 lines? Try editing out 1500 lines and see if it falls over at the same place.
Are you allocating memory dynamically and not releasing it?
Have you allocated a static buffer which you are overflowing?

I'm just using CString variables wherein it holds the data.
How can I clear the value of a variable? I'm just using = ""; (ex. translated = ""; ). Is it enough to clear the memory?

I'm just using CString variables wherein it holds the data.
How can I clear the value of a variable? I'm just using = ""; (ex. translated = ""; ). Is it enough to clear the memory?

Yes, that would clear it. There is a .Empty() method if you prefer that.

I'm just using CString variables wherein it holds the data.
How can I clear the value of a variable? I'm just using = ""; (ex. translated = ""; ). Is it enough to clear the memory?

It's only clearing the value of a variable, it's not releasing the assigned memory ...

It's only clearing the value of a variable, it's not releasing the assigned memory ...

I'm assuming he's referring to an MFC CString variable, in which case ="" would indeed release the memory.
He could be talking about something else though...

OK, in that case you are absolutely right !:)

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.