Windows Workflow Foundation 3


"Template" Workflow instances staying around and using too much memory


I understand that the first time the WF Runtime executes a workflow it actually instantiates two copies: one for the actual workflow execution, and one as a template instance that's used for validation as well as calls to GetWorkflowDefintion().
 
This poses a problem though, if you have many different workflow definitions that get executed over the lifetime of your process, because from what we're seeing these template instances are cached in memory forever, and if you have enough of them it can add up to a signficant amount of memory and substantially increase the working set for the application.
 
What I want to know is if there is any way to control how long these template instances remain in memory, or to at least specify how big the cache for these instances can get?
 
I suppose a brute-force method would be to tear down the WF Runtime and recreate it, but that could be difficult to do safely in our application and seems like a pretty ugly hack.
 
 

Related Links

A question for state machine workflow
XOML vs. XAML
Avalon.NET - WWF Runtime and AppDomains
Designer re-hosting and XAML only workflows
Editing XOML in VS2005 and other designer problems
Customizing work flow
Generating ruleset in runtime
WorkflowPersistence question
problem of cross-threading.
Terminating host leaves status in limbo
Runtime change in workflow
Beta2 Workflow Error
Changing which workflow items are available when modifying at runtime
ExpenseReport Sample Cancle Approval Question
Problem with sendmail Activity
Global Run Time Variable

Categories

MSDN
Using Forums
Microsoft Office for D...
Archived Forums C-D
Archived Forums E-H
Archived Forums SN-SZ
Archived Forums V
Cortana
Forums Issues (not pro...
Parallel Computing in ...
Visual Studio Setup an...
Visual Studio Tools fo...
Application Insights (AI)
Publishing Windows Sto...
Application Compatibil...
General Windows Deskto...
Windows Desktop Develo...
Windows Desktop Debugging
Windows Desktop Search...
Windows Desktop Pro-Au...
Message Analyzer
SharePoint Legacy Vers...
Service Bus
Azure Backup
Azure Search
Azure Cache
Azure Mobile Engagement
Azure SQL Data Warehouse
Azure DevTest Labs
Azure IoT Hub
Azure Disk Encryption
Publishing Apps for th...
Common Language Runtim...
Team Foundation Server...
Team Foundation Server...
Team Foundation Server...
ADO.NET Managed Providers
Microsoft Live Labs Volta
Microsoft Robotics - C...
Data Mining
SQL Server Spatial
Windows Embedded Compa...
SQL Server 2012 Analys...
SQL Server 2012 PowerP...
Windows Forms Designer
ClickOnce and Setup & ...
CRM
MSDN Magazine
Office Live Basics, Es...
Exchange Server Protocols
Office Protocols
Microsoft Unified Comm...
Microsoft Unified Comm...
Getting Started with S...
Performance Profiling ...
Expression Web and Sup...
Retired SharePoint Wor...
Retired SharePoint Ent...
Retired SharePoint Acc...
Retired SharePoint Col...
.NET Framework 4 Relea...
Announcements about pr...
AppFabric Service and ...
Axum Incubation Project
Audio API and Programm...
Casablanca
Feedback for Visual Ba...
Game Technologies: XNA...
HealthVault Data Types
Innovate on Office
LINQ Project General
LightSwitch HTML Clien...
Microsoft adCenter: De...
Monitor, Alert and Aut...
Network Class Library ...
Office Live Small Busi...
Office Live Small Busi...
Parallel Computing Pla...
patterns & practices: ...
Performance Counters f...
Popfly Explorer
Popfly General Discussion
NUI API and Programmin...
Search Server: Known B...
Silverlight (formerly ...
SQL Server 2014 High A...
SQL Server 2014 Integr...
Team Foundation Server...
Visual Basic Express E...
Visual Basic for Appli...
Visual Basic IDE
Visual Studio 2008 (Pr...
Visual Studio 2008 Exp...
Visual Studio Applicat...
Visual Studio Lab Mana...
Visual Studio Team Sys...
Visual Studio Team Sys...
Web Development in Vis...
Windows Desktop Vista ...
Windows Developer Prev...
Windows Live Data Deve...
Windows Phone push not...
XNA Framework
Windows Phone Preview ...
Windows Phone Preview SDK
Kinect for Windows v1 SDK
Azure N-Series Virtual...
Microsoft Partner Cent...

Resources

Encrypt Message



code
soft
python
ios
c
html
jquery
cloud
mobile