• Hello [name]! Thanks for joining the GMC. Before making any posts in the Tech Support forum, can we suggest you read the forum rules? These are simple guidelines that we ask you to follow so that you can get the best help possible for your issue.

Windows Anyone getting memory leak with network_send_udp?

J

JDBar

Guest
I'm posting this in case I'm doing something wrong, but I believe there may be a memory leak associated with network_send_udp.

I've made an empty project, and added the following:

obj_test Create Event
Code:
/// Create Server and Write to Buffer
server = network_create_server(network_socket_udp, 58008, 32);
buffer = buffer_create(1, buffer_grow, 1);
buffer_seek(buffer, buffer_seek_start, 0);
buffer_write(buffer, buffer_bool, true);
obj_test Step Event
Code:
/// Send buffer every step.
network_send_udp(server, "127.0.0.1", 58008, buffer, 1);
I set the room speed to about 500, and this is the result in debug mode:


Should I be sending data differently? Is there a way to avoid this?
 
J

JDBar

Guest
Well the buffer shouldn't grow unless I'm writing to it. I tested this with a fixed buffer as well, and the same pattern still occurs.

However, I have downloaded the EA 1.99.493 build and the leak is on that version as well, but it looks a bit different (even with the same code as above):
 
H

Husi012

Guest
Did you deleted the buffer after you'd sent it?
buffer_delete(buffer);
 
J

JDBar

Guest
Did you deleted the buffer after you'd sent it?
buffer_delete(buffer);
The buffer is only created once, and doesn't need to be destroyed after sending. For example, using the TCP-based network_send_packet with the same buffer will not cause memory usage to go up. Just in case, I tested creating a buffer before network_send_udp() and then destroying it after, but the memory leak is there all the same.
 
J

jackhigh24

Guest
can you go file a bug report to help desk, other wise it wont get fixed, supply them with an example gmx to, just in case your doing something wrong.
 
J

JDBar

Guest
can you go file a bug report to help desk, other wise it wont get fixed, supply them with an example gmx to, just in case your doing something wrong.
Yep. Got a reply saying they'll forward it to the QA team so I'll post when I have an update.
 
Top