Skip to content
This repository has been archived by the owner on May 24, 2023. It is now read-only.

Excessive memory usage #121

Open
Luoxin opened this issue Jul 13, 2022 · 0 comments
Open

Excessive memory usage #121

Luoxin opened this issue Jul 13, 2022 · 0 comments

Comments

@Luoxin
Copy link

Luoxin commented Jul 13, 2022

image

I use code in server

app.Use("/", func(c *fiber.Ctx) error {
		if websocket.IsWebSocketUpgrade(c) {
			c.Locals("allowed", true)
			return c.Next()
		}
		
		return fiber.ErrUpgradeRequired
	})

app.Get("/",
websocket.New(func(c *websocket.Conn) {
	c.Close()
},
	websocket.Config{
		HandshakeTimeout:  time.Second * 5,
		ReadBufferSize:    1024 * 1024 * 1024,
		WriteBufferSize:   1024 * 1024 * 1024,
		EnableCompression: true,
	},
))

and this in client

c, _, err := websocket.DefaultDialer.Dial("ws://127.0.0.1:8080/ws", nil)
if err != nil {
    log.Errorf("err:%v", err)
    return err
}

When I set up the link, the memory suddenly went up, because the client has retry mechanism, so I can see from the memory monitor that the memory went up twice

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant