IS Azure Webjobs have its own memory allocation?

2019-07-05 12:53发布

问题:

I am new to Azure web-jobs. When I am working with web-jobs I have come up with an question that whether web-job have its own memory allocation like process?

we are creating web-jobs under website(web app) so for website a separate memory will get created.And then we are creating multiple web-jobs under that website in azure.

so if static class gets instanciated under azure website instance.then web-jobs which uses that static class concurrently,will leads to data loss? like this

eg:

website --> static class1 memory instance get created.     
In webjob1 --> uses above created class1.      
In webjob2 --> uses above one class1.  

Webjobs uses only reference(shallow copy)

or

since webjob working as a process,it will create static class instance on its own memory?

eg:

In webjob1 memory --> static class1 memory instance get created inside webjob1's allocated memory.    
In webjob2 memory --> static class1  memory  instance get created inside webjob1's allocated memory.etc...   
both have its own static class like(deep copy)

Can anyone explain how it works? thanks in advance

回答1:

Each WebJob runs in its own process, which is distinct from the WebApp's process (w3wp). So they will each have their own copy of static variables.