1

I am trying to work some examples with the AWS CDK using C# as the language. My platform is Windows 10. Edit: I forgot to mention, I'm using a 64-bit Windows 10 and I have 16 GB of RAM.

I've followed the Getting Started instructions here: Getting Started With the AWS CDK, including making sure I have all the prerequisites.

I can create a project just fine, but when I try to use synth or deploy, it get the following:

Unhandled exception. Amazon.JSII.Runtime.JsiiException: Child process exited unexpectedly:
#
# Fatal process OOM in insufficient memory to create an Isolate
#


   at Amazon.JSII.Runtime.Services.Runtime.ReadResponse()
   at Amazon.JSII.Runtime.Services.Client.ReceiveResponse[TResponse]()
   at Amazon.JSII.Runtime.Services.Client.Hello()
   at Amazon.JSII.Runtime.Services.ServiceContainer.BuildServiceProvider(ILoggerFactory loggerFactoryOverride)
   at Amazon.JSII.Runtime.Services.ServiceContainer.<>c.<.cctor>b__8_0()
   at System.Lazy`1.ViaFactory(LazyThreadSafetyMode mode)
   at System.Lazy`1.ExecutionAndPublication(LazyHelper executionAndPublication, Boolean useDefaultConstructor)
   at System.Lazy`1.CreateValue()
   at System.Lazy`1.get_Value()
   at Amazon.JSII.Runtime.Services.ServiceContainer.get_ServiceProvider()
   at Amazon.JSII.Runtime.Deputy.JsiiTypeAttributeBase.Load(Assembly assembly)
   at Amazon.JSII.Runtime.Deputy.JsiiTypeAttributeBase.Load(Assembly assembly)
   at Amazon.JSII.Runtime.Deputy.JsiiTypeAttributeBase..ctor(Type nativeType, String fullyQualifiedName)
   at Amazon.JSII.Runtime.Deputy.JsiiClassAttribute..ctor(Type nativeType, String fullyQualifiedName, String parametersJson)
   at System.Reflection.CustomAttribute._CreateCaObject(RuntimeModule pModule, RuntimeType type, IRuntimeMethodInfo pCtor, Byte** ppBlob, Byte* pEndBlob, Int32* pcNamedArgs)
   at System.Reflection.CustomAttribute.CreateCaObject(RuntimeModule module, RuntimeType type, IRuntimeMethodInfo ctor, IntPtr& blob, IntPtr blobEnd, Int32& namedArgs)
   at System.Reflection.CustomAttribute.AddCustomAttributes(ListBuilder`1& attributes, RuntimeModule decoratedModule, Int32 decoratedMetadataToken, RuntimeType attributeFilterType, Boolean mustBeInheritable, ListBuilder`1 derivedAttributes)
   at System.Reflection.CustomAttribute.GetCustomAttributes(RuntimeModule decoratedModule, Int32 decoratedMetadataToken, Int32 pcaCount, RuntimeType attributeFilterType)
   at System.Reflection.CustomAttribute.GetCustomAttributes(RuntimeType type, RuntimeType caType, Boolean inherit)
   at System.RuntimeType.GetCustomAttributes(Type attributeType, Boolean inherit)
   at System.Attribute.GetCustomAttributes(MemberInfo element, Type type, Boolean inherit)
   at System.Attribute.GetCustomAttribute(MemberInfo element, Type attributeType, Boolean inherit)
   at System.Reflection.CustomAttributeExtensions.GetCustomAttribute[T](MemberInfo element)
   at Amazon.JSII.Runtime.ReflectionUtils.GetClassAttribute(Type type)
   at Amazon.JSII.Runtime.Deputy.DeputyBase..ctor(DeputyProps props)
   at Amazon.CDK.Construct..ctor(DeputyProps props)
   at Amazon.CDK.App..ctor(IAppProps props)
   at CdkHello.Program.Main(String[] args) in C:\VSTS\Sandbox\Hampson\cdk-hello\src\CdkHello\Program.cs:line 12
Subprocess exited with error 3762504530

Program.cs, line 12 is a generated line, unchanged from it's initial form.

I have searched repeatedly for this error, and all the search results point to node.js. But none of the solutions (all involving some form of setting max-old-space-size) work to clear this for me. As far as I can tell, all my Node and JS installs, as well as the CDK install are up to date.

I can repeatedly duplicate this by creating a new project, then trying to run synth or deploy on it:

cdk init app --language csharp
cdk synth

I've been struggling with this for several days and have no more ideas. Any suggestions would be welcome.

ahampson
  • 183
  • 1
  • 8
  • Some reports seem to indicate issues if using > 3GB (see `set NODE_OPTIONS=--max-old-space-size`) on a 32bit or otherwise setting the value too high as well.. – user2864740 Feb 12 '20 at 17:25
  • 1
    This goes into more details of 'Max Old Space Size' - https://stackoverflow.com/q/48387040/2864740 My hypothesis is it is set *too high* for the target machine and should be dialed back: "..if you set it too high, then the additional heap usage that *V8 will allow might cause your overall system to run out of memory*.." [or throw memory allocation errors if unable to obtain the memory from the OS]. – user2864740 Feb 12 '20 at 17:28
  • That link has a great explanation. Previously I've tried ```set NODE_OPTIONS=--max-old-space-size=``` from 1024 up to 8192, with no effect. – ahampson Feb 12 '20 at 17:55
  • Just to be clear, this isn't solved for me. So if anyone has other ideas, please chime in. – ahampson Feb 25 '20 at 14:15

0 Answers0