Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. Managed C++/CLI
  4. .Net Remoting Memory Horror (IPC channel)

.Net Remoting Memory Horror (IPC channel)

Scheduled Pinned Locked Moved Managed C++/CLI
helpcsharpc++asp-netvisual-studio
1 Posts 1 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • 2 Offline
    2 Offline
    2bee
    wrote on last edited by
    #1

    Hi, i have an application which is running as a windows service, it's purpose is to poll different sensors in a specific interval. No problem so far and with .Net memory profiler i was able to reduce the memory consumption drastically (allocs are almost -> 0 byte/s). But now the downside, my idea was to present the sensors data on a ASP.NET page. My first thought was using a webservice to connect the windows service with the IIS. However after reading a comparison between Remoting vs. Webservices i decided to do remoting with an IPC channel. So far so good, i have implemented a very light Remoting object, in addition i use the IPC channel and binary formatters. But when my application was finally running i discoverd that each remoting call will take around 8 KB of memory! Furthermore it allocates at least 178! Instances of differnt .Net classes for each call. Imagine that i have to update my data on the IIS every second and addionally i have more than one sensor. This would mean for example that 5 Sensors would cost 40 KB or more memory per second, surely the garbage collector will take care of it. But how long will it take until i get in serious memory trouble (like Memory Pressure by the framework)? I saw that the garbage collector is triggered every 10 s in the current setup (without remoting it's between 45 min - 2h) There are a couple of Questions: 1. Is it possible to reduce the memory consumption of .Net remoting? (i saw no difference between singleton & singecall) 2. Is remoting not the right choice for my task? BTW: The service is written in C++/CLI, the logic and pages on the IIS are in C#. I would really appreciate any help! If needed i could also publish some code to resolve the issue. ThanX Tobias the remoting Interface (each call of GetIndex costs 8KB): public interface class IRemotingLink { ArrayList^ GetSensorKeys (void); array ^ GetIndex (String^ pSensorGuid, unsigned char pIndex); array ^>^ GetIndices (String^ pSensorGuid); bool SetIndex (String^ pSensorGuid, unsigned char pIndex, array ^ pIndexContent); }; -- modified at 2:34 Friday 10th March, 2006

    1 Reply Last reply
    0
    Reply
    • Reply as topic
    Log in to reply
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes


    • Login

    • Don't have an account? Register

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • World
    • Users
    • Groups