Jump to content


Photo

network_send_udp memory issue?


  • Please log in to reply
7 replies to this topic

#1 Uncle Phil

Uncle Phil

    GMC Member

  • New Member
  • 7 posts
  • Version:GM:Studio

Posted 28 March 2016 - 03:46 PM

When I use network_send_udp, the memory usage of my game continually builds up. Is this a memory leak issue with the function itself, or am I not doing something right with it?


  • 0

#2 randomdude90

randomdude90

    GMC Member

  • GMC Member
  • 111 posts
  • Version:GM:Studio

Posted 28 March 2016 - 04:24 PM

Is it in your step event? Sending large packets every step can cause memory leaks.

 

What's your buffer look like? What type of information are you sending through your packets? And how much information are you sending through your packets?


  • 0

Visit my website and view all of my projects at: https://www.chrisburgess.us

or find me on the Gamemaker Marketplace at:https://marketplace....9/chris-burgess


#3 Uncle Phil

Uncle Phil

    GMC Member

  • New Member
  • 7 posts
  • Version:GM:Studio

Posted 28 March 2016 - 04:41 PM

Is it in your step event? Sending large packets every step can cause memory leaks.

 

What's your buffer look like? What type of information are you sending through your packets? And how much information are you sending through your packets?

buff = buffer_create(1024, buffer_grow, 1)
buffer_write(buff, buffer_u64, 214345)

That's all I wrote to it. Just an arbitrary value to test it with. I ran it in a project that only has an object that sends packets every step and surely enough it was using huge amounts of memory if I left it running for a bit.


Edited by Uncle Phil, 28 March 2016 - 04:46 PM.

  • 0

#4 djk164

djk164

    GMC Member

  • GMC Member
  • 301 posts
  • Version:GM:Studio

Posted 28 March 2016 - 04:53 PM

Where is your sending code?


  • 0

Bye old GMC!


#5 Uncle Phil

Uncle Phil

    GMC Member

  • New Member
  • 7 posts
  • Version:GM:Studio

Posted 28 March 2016 - 05:57 PM

Where is your sending code?

network_send_udp(sock, "127.0.0.1", 27015, buff, buffer_tell(buff))

Edited by Uncle Phil, 28 March 2016 - 05:57 PM.

  • 0

#6 djk164

djk164

    GMC Member

  • GMC Member
  • 301 posts
  • Version:GM:Studio

Posted 28 March 2016 - 06:15 PM

Where is this:

buff = buffer_create(1024, buffer_grow, 1)
buffer_write(buff, buffer_u64, 214345)

located?


  • 0

Bye old GMC!


#7 flyingsaucerinvasion

flyingsaucerinvasion

    GMC Member

  • GMC Member
  • 720 posts
  • Version:GM:Studio

Posted 28 March 2016 - 07:01 PM

you're not creating a new buffer every step, are you? 


  • 0

#8 Uncle Phil

Uncle Phil

    GMC Member

  • New Member
  • 7 posts
  • Version:GM:Studio

Posted 28 March 2016 - 11:24 PM

Where is this:

buff = buffer_create(1024, buffer_grow, 1)
buffer_write(buff, buffer_u64, 214345)

located?

Not in the step. If that's what you're wondering.


  • 0