x

Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

DestroySession causes out of memory in dedicated server

Hello, I recently managed to implement the steam onlinesubsystem, being able to create a dedicated server and let client find and join it. However when the game ends I tried to call DestroySession with corresponding session name, it immediately shows a warning about memory is not enough and later it says run out of memory when allocating about 48G spaces.

I create and start this session in C++ and none of these returns failure, except a warning "sessionflags:xxx overflows steam setgametags call", but the game runs normally in both server and client. In addition the destroysession works well if I use onlinesubsystemnulll. There is really little discussion about this.

Product Version: UE 4.16
Tags:
more ▼

asked Aug 11 '17 at 02:55 AM in C++ Programming

avatar image

swfly
1 1 2

avatar image spreiste Jan 04 '19 at 02:40 PM

Hey swfly, I encountered the same problem just now, did you ever find the cause of this problem? best regards, Stefan

avatar image swfly Jan 04 '19 at 02:43 PM

Hi Stefan, I totally forget what I did back to then... probably I just adopted the AdvancedSession or some plugin. Sorry it was too long ago... Good luck!

avatar image spreiste Jan 04 '19 at 04:18 PM

Oh bugger, thanks for the fast reply anyway!

avatar image spreiste Jan 07 '19 at 09:54 AM

On friday I found out that the crash happens in the callstack of FOnlineVoiceSteam::RemoveAllRemoteTalkers(). When trying to call "RemoteTalkers.Empty(MaxRemoteTalkers);" (so emptying a TArray). Does this trigger any memories for you? ^^'

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

1 answer: sort voted first

Disclaimer: This answer regards Unreal Engine version 4.20.3

So after some debugging I found the problem and the solution:

When using the Steam Subsystem and calling DestroySession the method FOnlineVoiceSteam::RemoveAllRemoteTalkers() is called. This is responsible to remove all data stored from remote voice talkers, even if you have the system deactivated in the ini file or never even have any connected.

The problem is in the following line: RemoteTalkers.Empty(MaxRemoteTalkers);

This tries to Empty() the TArray of remote talkers, but leave enough allocated space for the the possible maximum of remote talker data. What happens is: On dedicated servers the Init() function of FOnlineVoiceSteam is never called and therefore MaxRemoteTalkers is not initialized. The memory (on debug and dev builds) is filled with 0xcd and when translating that to numbers its something along the lines of 48 GB. (That's where that number comes from)

So the solution for me was:

Initialize the system, even on dedicated servers. (This means changing the source code of the engine) and recompiling. I basically copied the GetVoiceInterface() method from 4.21 Source as it tries to initialize the system on every GetVoiceInterface() as long as its not initalized.

Another solution would be: Upgrade to UE 4.21, it seems to be fixed there.

I hope this helps anyone! kind regards, Stefan

more ▼

answered Jan 11 '19 at 01:22 PM

avatar image

spreiste
6 1 1

avatar image swfly Jan 11 '19 at 01:29 PM

Great job man! Congratulations on a working solution!

(comments are locked)
10|2000 characters needed characters left
Viewable by all users
Your answer
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question