like below fixes the issue If you are compiling for 64-bit, then each pointer will be 64-bits in size. This also means that they may need to be aligned to 64-bits. So if you store 3 floats, it may have to insert 4 bytes of padding. So instead of saving 12 bytes, you only save 8. The padding will still be there whether the pointers are at the beginning of the struct or the end. This is necessary in order to put consecutive structs in arrays to continue to maintain alignment. Also, your structure is primarily composed of 3 pointers. The 8 bytes you save take you from a 48-byte object to a 40 byte object. That's not exactly a massive decrease. Again, if you're compiling for 64-bit.
Worker role starts with reasonable memory usage but then memory usage increases constantly
Any of those help It can definitely be the issue of unmanaged code leaking memory. Is RETSLib a .net wrapper on librets? Some references to php implementations of librets leaking memory. You mention "downloads some data and then images related to that data". Are you using Entity Framework to get this initial data or store it into SQL? If so I am assuming that you dispose of the ObjectContext. There have been instances where EF 4.0 seems to have some memory issues.
help you fix your problem The first thing to note is that how much memory that is totally used on the heap is not very interesting at all times, since much of the used memory can be garbage and will be cleared by the next GC. It is how much heap that is used by live objects that you need to be concerned about. You write in a comment:
I'm getting a process memory usage using PerformanceCounter. How can i display the memory usage in the same units as in
seems to work fine Working set represents the size of all pages belonging to the process. This variable shrinks and grows when pages are moved to the page file and when they are called back into main memory, respectively. It doesn't refer exclusively to memory your application uses, as such some shared memory might be counted twice in this metric. Look here for more info. Working set - Private is probably the metric you are looking for. Windows Task manager uses working set private as its memory usage metric. It doesn't concern itself with the page file, so you get an accurate representation of the impact on your physical ram, and it doesn't count shared objects twice.
PerformanceCounter performanceCounter = new PerformanceCounter();
performanceCounter.CategoryName = "Process";
performanceCounter.CounterName = "Working Set - Private";
performanceCounter.InstanceName = processes.ProcessName;
Java (Windows) - By process id, get memory usage, disk usage, network usage