Memory issues

This problem is getting to be very tiresome, I keep getting a memory problem at the point of downloading a sub. I;ve lost count of the number of times this has happened now - it used to happen with my 490EX but now it is happening much more frequently with the Moravian G4 (possibly because the images are much larger and thus require more memory).
Anyway, even using a single target per sequence it seems to happen:

[02/11/2015 21:18:17] [DEBUG] [Sequence Thread] TEMP - Current Event10: 2
[02/11/2015 21:18:17] [DEBUG] [Sequence Thread] Finished sending frame capture. Entering wait mode…
[02/11/2015 21:18:17] [DEBUG] [Sequence Thread] TEMP - Current Event11: 2
[02/11/2015 21:18:17] [DEBUG] [Sequence Thread] TEMP - Current Event12: 2
[02/11/2015 21:18:17] [DEBUG] [Camera Thread] SGM_CAMERA_CAPTURE message received…
[02/11/2015 21:18:17] [DEBUG] [Camera Thread] SetAscomNormalSpeed…
[02/11/2015 21:18:17] [DEBUG] [Camera Thread] Readout speed set to NORMAL…
[02/11/2015 21:18:17] [DEBUG] [Sequence Thread] TEMP - Current Event13: 2
[02/11/2015 21:18:37] [DEBUG] [Main Thread] PopulateDataModel: Transferring view to the data model…
[02/11/2015 21:18:37] [DEBUG] [MF Update Thread] Performing serialize…
[02/11/2015 21:20:42] [DEBUG] [Main Thread] PopulateDataModel: Transferring view to the data model…
[02/11/2015 21:33:17] [DEBUG] [Sequence Thread] TEMP - Current Event15: 2
[02/11/2015 21:33:17] [DEBUG] [Sequence Thread] Waking from exposure time sleep period…
[02/11/2015 21:33:17] [DEBUG] [Sequence Thread] Checking to see if the CCD has a temp…
[02/11/2015 21:33:17] [DEBUG] [Sequence Thread] Saving the CCD temp…
[02/11/2015 21:33:17] [DEBUG] [Sequence Thread] Entering super dangerous loop to await image completion…
[02/11/2015 21:33:17] [DEBUG] [Sequence Thread] TEMP - Current Event16: 2
[02/11/2015 21:33:43] [DEBUG] [Camera Thread] ASCOM Camera : Exception of type ‘System.OutOfMemoryException’ was thrown.
at System.RuntimeType.InvokeDispMethod(String name, BindingFlags invokeAttr, Object target, Object[] args, Boolean[] byrefModifiers, Int32 culture, String[] namedParameters)
at System.RuntimeType.InvokeMember(String name, BindingFlags bindingFlags, Binder binder, Object target, Object[] providedArgs, ParameterModifier[] modifiers, CultureInfo culture, String[] namedParams)
at System.Type.InvokeMember(String name, BindingFlags invokeAttr, Binder binder, Object target, Object[] args, CultureInfo culture)
at ASCOM.DriverAccess.MemberFactory.CallMember(Int32 memberCode, String memberName, Type[] parameterTypes, Object[] parms) in c:\ASCOM Build\Export\ASCOM.DriverAccess\MemberFactory.cs:line 294
at ASCOM.DriverAccess.Camera.get_ImageArray() in c:\ASCOM Build\Export\ASCOM.DriverAccess\Camera.cs:line 361
at ew.ay(cu A_0, he& A_1)
[02/11/2015 21:33:43] [DEBUG] [Camera Thread] ASCOM Camera: Attempting to abort exposure…
[02/11/2015 21:33:43] [DEBUG] [Camera Thread] ASCOM Camera: Exposure aborted…
[02/11/2015 21:33:43] [DEBUG] [Camera Thread] Error while attempting to capture frame…
[02/11/2015 21:33:50] [DEBUG] [Camera Thread] SGM_CAMERA_CAPTURE complete…
[02/11/2015 21:34:01] [DEBUG] [Sequence Thread] ASCOM Camera: Attempting to abort exposure…
[02/11/2015 21:34:01] [DEBUG] [Sequence Thread] ASCOM Camera: Exposure aborted…
[02/11/2015 21:34:01] [DEBUG] [Sequence Thread] Run event requested sequence abort…
[02/11/2015 21:34:01] [DEBUG] [Sequence Thread] Clearing timed monitoring events…
[02/11/2015 21:34:01] [DEBUG] [Sequence Thread] Checking RunEndOfSequenceEquipmentOptions, force = True
[02/11/2015 21:34:01] [DEBUG] [Sequence Thread] In RunEndOfSequenceEquipmentOptions
[02/11/2015 21:34:03] [DEBUG] [Sequence Thread] Dispatch loop: Received SGM_TERMINATE…
[02/11/2015 21:34:04] [DEBUG] [Main Thread] Disconnecting ASCOM camera: Gx ETH Imager…
[02/11/2015 21:34:04] [DEBUG] [Filter Wheel Thread] Filter Wheel Dispatch loop: Received SGM_TERMINATE…
[02/11/2015 21:34:04] [DEBUG] [TEC Thread] TEC Dispatch loop: Received SGM_TERMINATE…
[02/11/2015 21:34:04] [DEBUG] [Auto Guider Thread] Auto Guider Dispatch loop: Received SGM_TERMINATE…
[02/11/2015 21:34:04] [DEBUG] [Telescope Thread] Telescope Dispatch loop: Received SGM_TERMINATE…
[02/11/2015 21:34:04] [DEBUG] [Focuser Thread] Focuser Dispatch loop: Received SGM_TERMINATE…
[02/11/2015 21:34:04] [DEBUG] [Camera Thread] Camera Dispatch loop: Received SGM_TERMINATE…
[02/11/2015 21:34:04] [DEBUG] [Main Thread] Performing clean up…

and added to that I still have the other issue with SGP dropping the camera connection during cool-down. Neither SIPPS nor MaximDL have these problems.

Sorry Chris. We don’t really have any advice. We have thousands of active copies of SGPro out in the wild and this is literally the only report of this type of behavior. The error is being issued by software outside the control of SGPro so we can’t say much about it. Our refund policy indicates you have 30 days to return SGPro, but under special circumstances where SGPro just stops working for you we can extend this and refund your money. Please PM me if you’d like to do that.

Sorry we can’t be of more assistance.

Thanks for the offer but I’ll continue to use it with the 490EX. I do have a method of using it with the G4 now - I;ve been watching the memory usage while SGP is running and if I close the image window immediately after download I eventually get the memory back, although it takes about 5mins for SGP to release it. That prevents it running out of working memory but of course it cannot run automated that way - I think. If I don’t close the window (only one window - it’s re-used for new images) then SGP seems to keep using more and more memory until it falls over.

Are you using the “New window for every frame” option?

No I’m not, that’s a sure way of pushing the memory usage up!

I’ll take a look at this to see if I can reproduce it. What are your machine specs again (I think you noted them in the other thread, but I can’t find it)?

Hi Chris, is it possible to increase the virtual memory?
Just a thought that may or may not help.

Ray

Machine specs are Win64 machine, i7 proc, 32GB RAM.

I’ve been playing with this again today, taking a library of flats. The camera disconnect during cool-down is repeatable but I have a workaround for that one. The memory issue is odd, not consistant. When SGPro is first started and the first image comes in then the memory goes up from 85MB to about 200MB. I close the image window (no windows open at all now) and start another sub. This will download and the memory goes up to ~400MB. Close window again and start the next sub, the memory will drop to about 350 after 5 minutes then when the next sub downloads memory usage goes up to ~650MB. Next sub to 850MB and so on - until I get a memory error.

Thing is, I tried today with the flats (350 of them!) and after the initial rise in memory use up to about 700MB the memory suddenly droped back to ~500MB and just stayed there… which is what you would expect it to do (and if it did that during image data capture rather than these flats I likely would not have a problem). Difference here is that several other processes are not running (mount not running, focusser not running etc). So perhaps not and identical situation. I could not have those running because the hardware is outside and I’m taking flats indoors - so the other hardware is not physically connected, just the camera and filterwheel.

Next time out when I’m taking real image data I’m going to take a dozen flats to start with (just throw-away frames) then see if the memory usage during image aquisition still goes up. If it does, then I begin to suspect some other running process interacting badly with SGP. (* preventing it releasing memory…)

ChrisH

Version 2.4.3.14 has a change that “should” let SGPro address up to 4GB of memory on a 64-bit OS. This is obviously not a fix or good explanation for why this is happening to you, but might make whatever is happening slightly more tolerable until the problem’s cause is identified.

Thanks, I will try that immediately! You should perhaps look at the memory usage during autofocus too - the memory usage goes up tremendously (from 200-800MB) for no reason I can identify, and only after several minutes is that memory released. Perhaps it is my machine but it seemed odd as no other window other than frame/focus was open at the time… By the time I’m starting the first sub aquisition of a sequence the memory is already sitting at 800MB, but on the one occasion I monitored this it did eventually drop before the sub was completed and ready to download - not immediately though. I routinely monitor memory usage now while SGP is running and maybe this is expected behaviour :slight_smile:

ChrisH

I cannot reproduce this. Even aggressive (15 points, multiple times) tests with an 8300 (2x2) based camera consume about an additional 20MB of memory and stabilizes there (total of 66MB in memory)…