Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Out of memory issue when executing Publish-OSPlatformModule function #102

Open
wartang opened this issue Oct 18, 2021 · 5 comments
Open

Comments

@wartang
Copy link

wartang commented Oct 18, 2021

After an upgrade to the latest version of the platform IDE, when republishing over 400 modules using the line below, I always run into a out of memory issue in PowerShell. I have 12GB of ram on my server. Is that not enough? Is there a limitation to how many modules the script can republish at once? Am I running the script incorrectly?

Get-OSPlatformModules -Credential $SCCreds -PassThru -Filter {$_.StatusMessages.Id -eq 13} -ErrorAction Stop | Publish-OSPlatformModule -Wait -Verbose -ErrorAction Stop | Out-Null

@wartang
Copy link
Author

wartang commented Oct 20, 2021

After reviewing the logs, it generates the OutofMemory after about 2 hours of powershell executing....

VERBOSE : 2021-10-19 19:02:52.4800 [Publish-OSPlatformModule ] [PROCESS] Service Center: Preparing Deploy - Preparing deploy of module 'Logging_Lib'.
VERBOSE : 2021-10-19 19:02:54.7457 [Publish-OSPlatformModule ] [PROCESS] Service Center: Preparing Deploy - Preparing deploy of module 'LoginHistory'.
ERROR : 2021-10-19 19:02:56.8707 [Publish-OSPlatformModule ] [PROCESS] Error checking the publication status ( Publish Id: 3590 )
InnerException:
Exception of type 'System.OutOfMemoryException' was thrown.
at System.RuntimeTypeHandle.CreateInstance(RuntimeType type, Boolean publicOnly, Boolean noCheck, Boolean& canBeCached, RuntimeMethodHandleInternal& ctor, Boolean& bNeedSecurityCheck)
at System.RuntimeType.CreateInstanceSlow(Boolean publicOnly, Boolean skipCheckThis, Boolean fillCache, StackCrawlMark& stackMark)
at System.Activator.CreateInstance(Type type, Boolean nonPublic)
at System.RuntimeType.CreateInstanceImpl(BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes, StackCrawlMark& stackMark)
at System.Activator.CreateInstance(Type type, BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes)
at System.Reflection.Assembly.CreateInstance(String typeName, Boolean ignoreCase, BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes)
at Microsoft.PowerShell.Commands.NewWebServiceProxy.InstantinateWebServiceProxy(Assembly assembly)
at Microsoft.PowerShell.Commands.NewWebServiceProxy.BeginProcessing()
at System.Management.Automation.Cmdlet.DoBeginProcessing()
at System.Management.Automation.CommandProcessorBase.DoBegin()

@pintonunes
Copy link
Contributor

Hi @wartang. Yes, you're totally right. This is know problem cause we are creating a New-WebServiceProxy on each request instead of re-using an existing one. Even while checking for publication results.

$platformServicesWS = New-WebServiceProxy -Uri $platformServicesUri -ErrorAction Stop -Namespace 'OutSystems.PlatformServices'

Feel free to PR with a fix if you want.

@wartang
Copy link
Author

wartang commented Nov 17, 2021

Thanks for the reply. Would you possibly have a fix for me to implement so it doesn't keep creating a New-WebServiceProxy on each request? We have a lot of modules so I would love to use this command. I am unsure what to change or update myself

@wartang
Copy link
Author

wartang commented Jan 10, 2022

Is someone able to provide a fix so the script re-uses the existing request instead of recreating it every time, causing it to eventually run out of memory?

@wartang
Copy link
Author

wartang commented Apr 4, 2022

Does anybody have a fix or a workaround for this out of memory issue yet? Hoping someone has an idea on how to run the publishing script since the number of modules are only increasing over time.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants