Question: I have following Java method and it returns String depending on time interval. It works fine when the intervals are like 6-14h. 

```
private String shiftCount()
{
  Calendar time = Calendar.getInstance();
  if ((time.get(Calendar.HOUR_OF_DAY) >=  0) && (time.get(Calendar.HOUR_OF_DAY) <  6)) return "-S1";
  if ((time.get(Calendar.HOUR_OF_DAY) >=  6) && (time.get(Calendar.HOUR_OF_DAY) < 14)) return "-S2";
  if ((time.get(Calendar.HOUR_OF_DAY) >= 14) && (time.get(Calendar.HOUR_OF_DAY) < 22)) return "-S3";
  if ((time.get(Calendar.HOUR_OF_DAY) >= 22) && (time.get(Calendar.HOUR_OF_DAY) < 24)) return "-S1";   
  return null;
}

```

But what if i need e.g. 6:10-14:10 interval?

Answer: 
It sounds more like garbage collector hasn't run yet and because of that the memory wasn't released. Moreover when hosting WCF service in console application the `GC` runs in Workstation mode which can be less effective in such case.
Use a tool like this to see what objects are being created/collected:
<http://memprofiler.com/>

I wouldn't worry too much if GC isn't being run after each call - this wouldn't be very efficient anyway - the garbage collector will run at a point when the .NET framework determines that objects are old enough to be collected. If memory starts to run low then this will happen more frequently.