QPlainTextEdit memory leak
up vote
0
down vote
favorite
I wrote a simple app with Qt 5.9.6, I ran that and wondered the used memory is growing.
After tracing/debugging my application, I realized something about QPlainTextEdit !!!
The memory leak was for a qplaintextedit as a scratchpad in my app, but after every use of that, I used the clear() function to blank it for next use.
But the used memory by that scratchpad woudn't be released!
I decided to test it
I opened a new project, containing a QPlainTextEdit & a QPushButton(to use clear() function).
- After run, the used memory was
9.7MiB
- Entered some long text to QPlainTextEdit, the used memory was
52MiB
- Pressed the QPushButton(clear() the QPlainTextEdit), the expected used memory is
9.7MiB
, but it was52MiB
.
I tried delete, static allocation, dynamic allocation..., many ways to manage that, but no different!
I found something in here, but it couldn't solve the problem.
Is this a bug in QPlainTextEdit or I'm doing wrong?
memory-management memory-leaks g++ qwidget qplaintextedit
add a comment |
up vote
0
down vote
favorite
I wrote a simple app with Qt 5.9.6, I ran that and wondered the used memory is growing.
After tracing/debugging my application, I realized something about QPlainTextEdit !!!
The memory leak was for a qplaintextedit as a scratchpad in my app, but after every use of that, I used the clear() function to blank it for next use.
But the used memory by that scratchpad woudn't be released!
I decided to test it
I opened a new project, containing a QPlainTextEdit & a QPushButton(to use clear() function).
- After run, the used memory was
9.7MiB
- Entered some long text to QPlainTextEdit, the used memory was
52MiB
- Pressed the QPushButton(clear() the QPlainTextEdit), the expected used memory is
9.7MiB
, but it was52MiB
.
I tried delete, static allocation, dynamic allocation..., many ways to manage that, but no different!
I found something in here, but it couldn't solve the problem.
Is this a bug in QPlainTextEdit or I'm doing wrong?
memory-management memory-leaks g++ qwidget qplaintextedit
add a comment |
up vote
0
down vote
favorite
up vote
0
down vote
favorite
I wrote a simple app with Qt 5.9.6, I ran that and wondered the used memory is growing.
After tracing/debugging my application, I realized something about QPlainTextEdit !!!
The memory leak was for a qplaintextedit as a scratchpad in my app, but after every use of that, I used the clear() function to blank it for next use.
But the used memory by that scratchpad woudn't be released!
I decided to test it
I opened a new project, containing a QPlainTextEdit & a QPushButton(to use clear() function).
- After run, the used memory was
9.7MiB
- Entered some long text to QPlainTextEdit, the used memory was
52MiB
- Pressed the QPushButton(clear() the QPlainTextEdit), the expected used memory is
9.7MiB
, but it was52MiB
.
I tried delete, static allocation, dynamic allocation..., many ways to manage that, but no different!
I found something in here, but it couldn't solve the problem.
Is this a bug in QPlainTextEdit or I'm doing wrong?
memory-management memory-leaks g++ qwidget qplaintextedit
I wrote a simple app with Qt 5.9.6, I ran that and wondered the used memory is growing.
After tracing/debugging my application, I realized something about QPlainTextEdit !!!
The memory leak was for a qplaintextedit as a scratchpad in my app, but after every use of that, I used the clear() function to blank it for next use.
But the used memory by that scratchpad woudn't be released!
I decided to test it
I opened a new project, containing a QPlainTextEdit & a QPushButton(to use clear() function).
- After run, the used memory was
9.7MiB
- Entered some long text to QPlainTextEdit, the used memory was
52MiB
- Pressed the QPushButton(clear() the QPlainTextEdit), the expected used memory is
9.7MiB
, but it was52MiB
.
I tried delete, static allocation, dynamic allocation..., many ways to manage that, but no different!
I found something in here, but it couldn't solve the problem.
Is this a bug in QPlainTextEdit or I'm doing wrong?
memory-management memory-leaks g++ qwidget qplaintextedit
memory-management memory-leaks g++ qwidget qplaintextedit
asked Nov 19 at 16:08
mohammads
1706
1706
add a comment |
add a comment |
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Some of your past answers have not been well-received, and you're in danger of being blocked from answering.
Please pay close attention to the following guidance:
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53378583%2fqplaintextedit-memory-leak%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown