Skip to content

Memory usage increases significantly per character in Entry #2969

@VideoCarp

Description

@VideoCarp

Apparently, this is not a bug. It is still important to point it out, though.
And I can’t delete the issue, anyway.

After searching, I could not find anything related to this.

Describe the bug:

Entry seems to have some problems with memory. Adding any character drastically increased memory usage.

The memory usage increases extremely quickly when characters are added to a widget Entry. I added the string "Hello" in
a text entry. The memory usage jumped from a stable 14.2 MB to a stable 18 MB. I left it for a while and the memory was still high.
I also gave it 100 characters. The memory went from 14.2 MB to a stable 22.5 MB.
And giving it 245, it managed to reach 110 MB of memory usage. But this was a multiline entry.

To Reproduce:

Steps to reproduce the behaviour:
Use this code: https://paste.gg/p/anonymous/b92b73bf8870438895df687f2a7984d1
which creates a widget.NewEntry in a container.New with a layout.NewGridLayout.
Run go mod init
Run go mod tidy
Compile with go build -ldflags -H=windowsgui or equivalent.

Screenshots:

image
image
image
image

The last image has a roughly 245 characters. Though, it is of a MultiLineEntry
(Note: I restarted the app for every picture). Sorry if the images aren't clear, I don't know why that suddenly happened. They should be readable, though.

Example code:

app := app.New()
win := app.NewWindow("")
content := container.New(
    widget.NewEntry(),
)
win.SetContent(content)
win.ShowAndRun()

Device (please complete the following information):

  • OS: Windows
  • Version: 10
  • Go version: 1.18.1
  • Fyne version: v2.1.4

Metadata

Metadata

Assignees

No one assigned

    Labels

    blockerItems that would block a forthcoming releaseenhancementNew feature or requestoptimizationTickets that could help Fyne apps run faster

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions