Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6542319
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T11:12:43+00:00 2026-05-25T11:12:43+00:00

I inherited this huge application consisting of client and server code, and I’m trying

  • 0

I inherited this huge application consisting of client and server code, and I’m trying to change the transfer mode for parts of our communication to ‘streamed’, to get around the really wasteful memory consumption that can occur in buffered mode and makes my client throw OOM exceptions, see also this answer.

The code goes something like this:

GZipMessageEncodingBindingElement gElement = new GZipMessageEncodingBindingElement();

HttpsTransportBindingElement hElement = new HttpsTransportBindingElement();
hElement.TransferMode = TransferMode.Streamed;
hElement.MaxBufferSize = int.MaxValue;
hElement.MaxBufferPoolSize = int.MaxValue;
hElement.MaxReceivedMessageSize = int.MaxValue;

CustomBinding binding = new CustomBinding();
binding.SendTimeout = new TimeSpan(0, 0, 60);
binding.Elements.Add(gElement);
binding.Elements.Add(hElement);

EndpointAddress address = new EndpointAddress(uri);

return new ChannelFactory<T>(binding, address).CreateChannel();

And the exception is a TimeoutException that suggests I increase the SendTimeout (which currently is set to 1 minute).

Update: However, there are 2 services that still work after setting the transferMode to streamed, I actually confirmed that they use GZIP/HTTPS by setting breakpoints in GZIPMessageEncoder.ReadMessage(Stream, …). So for 2 services it breaks inside ReadMessage, for one service it doesn’t. As far is I can tell, the services are configured identically, when it comes to ConcurrencyMode and InstanceContextMode.

Update 2: After configuring only the one service that didn’t seem to work as Streamed and leaving the other 2 services buffered, it partly worked. So it is not the service as such that is bad, maybe some connection is getting in the way of other connections in Streamed mode, making them time-out.

If I delete just the ‘TransferMode’ line, everything is fine, and the test server never needs more than a second or so to respond, so just increasing the SendTimeout won’t lead anywhere.

For this test, I only changed the client btw., as to my understanding, this setting should not affect the way client and server communicate, just the way that the application with the “streamed” setting processes the data.

Please be easy on me, I’m a total WCF newb, and although I have seen some caveats on the MSDN pages about the streamed transfer mode, a pointer at what to grep for in my code / configuration would be really helpful, otherwise it’s just huge, many services, each with different transport settings etc.

Thanks!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T11:12:44+00:00Added an answer on May 25, 2026 at 11:12 am

    I could not exactly figure out the cause of the issue, but I was able to fix the issue and getting rid of excessive memory consumption etc. by doing the following.

    After getting rid of GzipMessageEncoder (see wcf conditional compression for how to replace it by IIS’ builtin compression), which is a monstrosity (see my answer on WCF HttpTransport: streamed vs buffered TransferMode), it was easy to switch to streamed TransferMode: How can I prevent BufferManager / PooledBufferManager in my WCF client app from wasting memory?.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Warning: This is inherited legacy code that was initially put together in the early
I've inherited some python code that contains a rather cryptic decorator. This decorator sets
So I inherited this Android project from someone else. The code currently seems to
So I'm pretty new to Visual Basic and inherited this VB6 code that i
I inherited this hellish query designed for pagination in SQL Server. It's only getting
I inherited this gigantic legacy Java web app using Struts 1.2.4. I have a
I inherited this gigantic legacy Java web app using Struts 1.2.4. I have a
this is my inherited class of UIView : MobileView @interface MobileView : UIView {
This is my first time doing VB :-) I've inherited a web site, which
I have inherited a subversion repo which looks like this: https://foo/product/src I want to

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.