[{"data":1,"prerenderedAt":483},["ShallowReactive",2],{"article-node-js-server-side-javascript-process-consuming-too-much-memory":3},{"article":4,"tags":226,"previous":254,"next":383},{"id":5,"title":6,"author":7,"body":8,"createdAt":214,"description":215,"extension":216,"img":204,"meta":217,"navigation":218,"path":219,"seo":220,"stem":221,"tags":222,"updatedAt":214,"__hash__":225},"articles\u002Farticles\u002Fnode-js-server-side-javascript-process-consuming-too-much-memory.md","Node.js server-side JavaScript process consuming too much memory",null,{"type":9,"value":10,"toc":212},"minimark",[11,15,18,173,176,179,182,208],[12,13,14],"p",{},"After the installation of Visual Studio 2017 latest edition, I have been watching memory consumption. Node.exe seems to be consistently around 500-700mb of RAM!. I did find this post which helps explain what is going on.",[12,16,17],{},"The node process you are seeing is powering the JavaScript language service. You will see this process appear anytime you edit a JS file, TS file, or any file with JS\u002FTS inside (html, cshtml, etc). This process is what powers IntelliSense, code navigation, formatting, and other editing features and it does this by analyzing the entire context of your project. If you have a lot of .js files in your project, this can get large, but more than likely the issue is that you have a lot of library files that are being analyzed. By default, we will scan every .js\u002F.ts file in your project. But you can override this behavior and tune the language service to only focus on your code. To do this create a tsconfig.json in your project root with the following settings:”",[19,20,25],"pre",{"className":21,"code":22,"language":23,"meta":24,"style":24},"language-js shiki shiki-themes github-light github-dark","{\n    \"compilerOptions\": {\n        \"allowJs\": true,\n        \"noEmit\": true\n    },\n    \"exclude\": [\n        \"wwwroot\u002Flib\" \u002F\u002Fignore everything in the lib folder (bootstrap, jquery, etc)  \n        \u002F\u002F add any other folders with library code here\n    ],\n    \"typeAcquisition\": { \n        \"enable\": true,\n        \"include\": [\n            \"bootstrap\"\n            \"jquery\"  \u002F\u002Flist libraries you are using here\n        ]\n    }\n}  \n","js","",[26,27,28,37,47,63,74,80,89,99,105,111,120,132,140,146,155,161,167],"code",{"__ignoreMap":24},[29,30,33],"span",{"class":31,"line":32},"line",1,[29,34,36],{"class":35},"sVt8B","{\n",[29,38,40,44],{"class":31,"line":39},2,[29,41,43],{"class":42},"sZZnC","    \"compilerOptions\"",[29,45,46],{"class":35},": {\n",[29,48,50,53,56,60],{"class":31,"line":49},3,[29,51,52],{"class":42},"        \"allowJs\"",[29,54,55],{"class":35},": ",[29,57,59],{"class":58},"sj4cs","true",[29,61,62],{"class":35},",\n",[29,64,66,69,71],{"class":31,"line":65},4,[29,67,68],{"class":42},"        \"noEmit\"",[29,70,55],{"class":35},[29,72,73],{"class":58},"true\n",[29,75,77],{"class":31,"line":76},5,[29,78,79],{"class":35},"    },\n",[29,81,83,86],{"class":31,"line":82},6,[29,84,85],{"class":42},"    \"exclude\"",[29,87,88],{"class":35},": [\n",[29,90,92,95],{"class":31,"line":91},7,[29,93,94],{"class":42},"        \"wwwroot\u002Flib\"",[29,96,98],{"class":97},"sJ8bj"," \u002F\u002Fignore everything in the lib folder (bootstrap, jquery, etc)  \n",[29,100,102],{"class":31,"line":101},8,[29,103,104],{"class":97},"        \u002F\u002F add any other folders with library code here\n",[29,106,108],{"class":31,"line":107},9,[29,109,110],{"class":35},"    ],\n",[29,112,114,117],{"class":31,"line":113},10,[29,115,116],{"class":42},"    \"typeAcquisition\"",[29,118,119],{"class":35},": { \n",[29,121,123,126,128,130],{"class":31,"line":122},11,[29,124,125],{"class":42},"        \"enable\"",[29,127,55],{"class":35},[29,129,59],{"class":58},[29,131,62],{"class":35},[29,133,135,138],{"class":31,"line":134},12,[29,136,137],{"class":42},"        \"include\"",[29,139,88],{"class":35},[29,141,143],{"class":31,"line":142},13,[29,144,145],{"class":42},"            \"bootstrap\"\n",[29,147,149,152],{"class":31,"line":148},14,[29,150,151],{"class":42},"            \"jquery\"",[29,153,154],{"class":97},"  \u002F\u002Flist libraries you are using here\n",[29,156,158],{"class":31,"line":157},15,[29,159,160],{"class":35},"        ]\n",[29,162,164],{"class":31,"line":163},16,[29,165,166],{"class":35},"    }\n",[29,168,170],{"class":31,"line":169},17,[29,171,172],{"class":35},"}\n",[12,174,175],{},"Another option",[12,177,178],{},"Disabling the TypeScript extension is a workaround for the moment, at least for me. Click Tools, Extensions and Updates, search for \"TypeScript\" and disable it. Restart Visual Studio.”",[12,180,181],{},"Give it a try and let me know how it goes.",[12,183,184,185,189,193,196],{},"Reference: ",[186,187],"a",{"title":188,"href":188},"https:\u002F\u002Fdevelopercommunity.visualstudio.com\u002Fcontent\u002Fproblem\u002F27033\u002Fnodejs-server-side-javascript-process-consuming-to.html",[186,190,188],{"href":188,"rel":191},[192],"nofollow",[194,195],"br",{},[186,197,200],{"style":198,"href":199},"display: none;","\u002Farticles\u002Fimages\u002Fopen-live-writer-nodjs-server-side-javascript-process-co_13be9-js_2.png",[201,202],"img",{"style":203,"title":23,"src":204,"alt":23,"width":205,"height":206,"border":207},"background-image: none; padding-top: 0px; padding-left: 0px; display: inline; padding-right: 0px; border-width: 0px;","\u002Farticles\u002Fimages\u002Fopen-live-writer-nodjs-server-side-javascript-process-co_13be9-js_thumb.png",203,156,0,[209,210,211],"style",{},"html pre.shiki code .sVt8B, html code.shiki .sVt8B{--shiki-default:#24292E;--shiki-dark:#E1E4E8}html pre.shiki code .sZZnC, html code.shiki .sZZnC{--shiki-default:#032F62;--shiki-dark:#9ECBFF}html pre.shiki code .sj4cs, html code.shiki .sj4cs{--shiki-default:#005CC5;--shiki-dark:#79B8FF}html pre.shiki code .sJ8bj, html code.shiki .sJ8bj{--shiki-default:#6A737D;--shiki-dark:#6A737D}html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html.dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}",{"title":24,"searchDepth":39,"depth":39,"links":213},[],"2017-03-17T06:10:45.510Z","After the installation of Visual Studio 2017 latest edition, I have been watching memory consumption.  Node.exe seems to be consistently around 500-700mb of RAM!.  I did find this post which helps explain what is going on.","md",{},true,"\u002Farticles\u002Fnode-js-server-side-javascript-process-consuming-too-much-memory",{"title":6,"description":215},"articles\u002Fnode-js-server-side-javascript-process-consuming-too-much-memory",[223,224],"visualstudio","node","tfPFLFfbdUgW8RNm41oUcBHq_jakGfUAHcj1hY7w06Y",[227,241],{"id":228,"title":229,"body":230,"description":234,"extension":216,"img":235,"meta":236,"name":224,"navigation":218,"path":237,"seo":238,"stem":239,"__hash__":240},"tags\u002Ftags\u002Fnode.md","Node",{"type":9,"value":231,"toc":232},[],{"title":24,"searchDepth":39,"depth":39,"links":233},[],"Node allows developers to write JavaScript code that runs directly in a computer process itself instead of in a browser. Node can, therefore, be used to write server-side applications with access to the operating system, file system, and everything else required to build fully-functional applications.","https:\u002F\u002Fimages.unsplash.com\u002Fphoto-1598313183973-4effcded8d5e?ixlib=rb-1.2.1&ixid=eyJhcHBfaWQiOjEyMDd9&auto=format&fit=crop&w=675&q=80",{},"\u002Ftags\u002Fnode",{"description":234},"tags\u002Fnode","kBZEUEYUGIoLCPM88yi6RG1QD8TIc4JbSwgSFvC1_Gc",{"id":242,"title":243,"body":244,"description":248,"extension":216,"img":235,"meta":249,"name":223,"navigation":218,"path":250,"seo":251,"stem":252,"__hash__":253},"tags\u002Ftags\u002Fvisualstudio.md","Visualstudio",{"type":9,"value":245,"toc":246},[],{"title":24,"searchDepth":39,"depth":39,"links":247},[],"Develop apps for Android, iOS, Mac, Windows, web, and cloud",{},"\u002Ftags\u002Fvisualstudio",{"description":248},"tags\u002Fvisualstudio","glm3bYyBlAXGun4NJe-CV_iOzhszydeBRIpbGNNLeEk",{"id":255,"title":256,"author":257,"body":258,"createdAt":372,"description":373,"extension":216,"img":374,"meta":375,"navigation":218,"path":376,"seo":377,"stem":378,"tags":379,"updatedAt":372,"__hash__":382},"articles\u002Farticles\u002Fjquery-mvc-and-textarea-length-validation.md","jQuery \u002F MVC and TextArea Length Validation","[object Object]",{"type":9,"value":259,"toc":370},[260,263,269,272,275,367],[12,261,262],{},"I came across this issue today, and actually surprised I have not had to resolve this problem earlier.",[12,264,265,266,268],{},"When validating a textarea on the client side with jQuery unobtrusive validation (for length) you have to be conscientious about how JavaScript deals with carriage return\u002Fline feed characters in comparison to the posted values to your controller.  For example on the client JavaScript sees CR\u002FLF as \\n while after posted to the server that same CR\u002FLF will be represented by \\r\\n.  If you are validating the user entered data for length your counts will be different depending on the environment (i.e. model will pass validation on the client but fail on the server).",[194,267],{},"\nThe resolution was to fix the data server side.",[12,270,271],{},"This was done with a customization\u002Fextension to the DefaultModelBinder, so that all controller actions will benefit immediately.",[12,273,274],{},"You will notice that I trimmed the original input and then replaced \\r\\n with \\n.",[19,276,280],{"className":277,"code":278,"language":279,"meta":24,"style":24},"language-cs shiki shiki-themes github-light github-dark","        protected override void BindProperty(ControllerContext controllerContext, ModelBindingContext bindingContext, PropertyDescriptor propertyDescriptor)  \n        {  \n            base.BindProperty(controllerContext, bindingContext, propertyDescriptor);  \n  \n            \u002F\u002F Note: if desired, one could restrict the conversion to properties decorated with [StringLength]:  \n            \u002F\u002F &amp;&amp; propertyDescriptor.Attributes.OfType().Any()  \n            if (propertyDescriptor.PropertyType == typeof(string))  \n            {  \n                var originalString = propertyDescriptor.GetValue(bindingContext.Model) as string;  \n                if (!string.IsNullOrEmpty(originalString))  \n                {  \n                    originalString = originalString.Trim();  \n                    var stringWithNormalizedNewlines = originalString.Replace(\"\\r\\n\", \"\\n\");  \n                    propertyDescriptor.SetValue(bindingContext.Model, stringWithNormalizedNewlines);  \n                }  \n            }  \n        }\n","cs",[26,281,282,287,292,297,302,307,312,317,322,327,332,337,342,347,352,357,362],{"__ignoreMap":24},[29,283,284],{"class":31,"line":32},[29,285,286],{},"        protected override void BindProperty(ControllerContext controllerContext, ModelBindingContext bindingContext, PropertyDescriptor propertyDescriptor)  \n",[29,288,289],{"class":31,"line":39},[29,290,291],{},"        {  \n",[29,293,294],{"class":31,"line":49},[29,295,296],{},"            base.BindProperty(controllerContext, bindingContext, propertyDescriptor);  \n",[29,298,299],{"class":31,"line":65},[29,300,301],{},"  \n",[29,303,304],{"class":31,"line":76},[29,305,306],{},"            \u002F\u002F Note: if desired, one could restrict the conversion to properties decorated with [StringLength]:  \n",[29,308,309],{"class":31,"line":82},[29,310,311],{},"            \u002F\u002F &amp;&amp; propertyDescriptor.Attributes.OfType().Any()  \n",[29,313,314],{"class":31,"line":91},[29,315,316],{},"            if (propertyDescriptor.PropertyType == typeof(string))  \n",[29,318,319],{"class":31,"line":101},[29,320,321],{},"            {  \n",[29,323,324],{"class":31,"line":107},[29,325,326],{},"                var originalString = propertyDescriptor.GetValue(bindingContext.Model) as string;  \n",[29,328,329],{"class":31,"line":113},[29,330,331],{},"                if (!string.IsNullOrEmpty(originalString))  \n",[29,333,334],{"class":31,"line":122},[29,335,336],{},"                {  \n",[29,338,339],{"class":31,"line":134},[29,340,341],{},"                    originalString = originalString.Trim();  \n",[29,343,344],{"class":31,"line":142},[29,345,346],{},"                    var stringWithNormalizedNewlines = originalString.Replace(\"\\r\\n\", \"\\n\");  \n",[29,348,349],{"class":31,"line":148},[29,350,351],{},"                    propertyDescriptor.SetValue(bindingContext.Model, stringWithNormalizedNewlines);  \n",[29,353,354],{"class":31,"line":157},[29,355,356],{},"                }  \n",[29,358,359],{"class":31,"line":163},[29,360,361],{},"            }  \n",[29,363,364],{"class":31,"line":169},[29,365,366],{},"        }\n",[209,368,369],{},"html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html.dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}",{"title":24,"searchDepth":39,"depth":39,"links":371},[],"2017-05-29T20:59:15.3883517Z","Surprised about a jQuery issue.","\u002Farticles\u002Fimages\u002Fc1zuUO5OvF.png",{},"\u002Farticles\u002Fjquery-mvc-and-textarea-length-validation",{"title":256,"description":373},"articles\u002Fjquery-mvc-and-textarea-length-validation",[380,381],"javascript","aspnet","A1TBFqd_HmSDNRRkH9XShYU1vUr45yBIdO-DMLgubPI",{"id":384,"title":385,"author":7,"body":386,"createdAt":474,"description":475,"extension":216,"img":444,"meta":476,"navigation":218,"path":477,"seo":478,"stem":479,"tags":480,"updatedAt":474,"__hash__":482},"articles\u002Farticles\u002Fforms-master-detail-template.md","Xamarin Forms Master Detail Template",{"type":9,"value":387,"toc":472},[388,391,402,409,424,429,432,435,447,455],[12,389,390],{},"The current Xamarin Forms master detail template is broken. You will get an error like Error CS0101 The namespace 'already contains a definition for",[12,392,393,394,401],{},"The fix..(thank you ",[186,395,400],{"href":396,"target":397,"rel":398},"https:\u002F\u002Fforums.xamarin.com\u002Fprofile\u002F120906\u002FKymPhillpotts.3866","_blank",[399],"noopener","Kym Phillpotts",")",[403,404,405],"ol",{},[406,407,408],"li",{},"It would appear, that the added pages have the wrong namespace. So change the namespace on the added pages",[410,411,412,415,418,421],"ul",{},[406,413,414],{},"Page1.xaml.cs - change the Namespace to be just MyApp",[406,416,417],{},"Page1Detail.xaml.cs - Change the namespace to be just MyApp",[406,419,420],{},"Page1Master.xaml.cs - Change the namespace to be just MyApp",[406,422,423],{},"Page1MenuItem.cs - Change the namespace to \"MyApp\"",[403,425,426],{"start":39},[406,427,428],{},"I also noticed that in the Page1Master.xaml.cs it is incorrectly referencing the MenuItems.  It says Page1MenuItems = new ObservableCollection...Change that to be justMenuItems = new ObservableCollection...",[12,430,431],{},"No you can go to your App.Xaml.xs and set the Page1 as the master page:",[12,433,434],{},"eg.MainPage = new MyApp.Page1()",[12,436,437],{},[186,438,440],{"href":439},"\u002Farticle\u002Fimages\u002Fopen-live-writer-70a95c1575c8_decb-image_2.png",[201,441],{"style":442,"title":443,"src":444,"alt":443,"width":445,"height":446,"border":207},"background-image: none; padding-top: 0px; padding-left: 0px; display: inline; padding-right: 0px; border: 0px;","image","\u002Farticles\u002Fimages\u002Fopen-live-writer-70a95c1575c8_decb-image_thumb.png",428,296,[12,448,184,449,452],{},[186,450],{"title":451,"href":451},"https:\u002F\u002Fforums.xamarin.com\u002Fdiscussion\u002F89346\u002Fforms-master-detail-page-generation-is-broken",[186,453,451],{"href":451,"rel":454},[192],[12,456,457,458,460,463,466,469],{},"Also there are bugs in Bugzilla for both of these:",[194,459],{},[186,461],{"href":462},"https:\u002F\u002Fbugzilla.xamarin.com\u002Fshow_bug.cgi?id=53020",[186,464,462],{"href":462,"rel":465},[192],[186,467],{"href":468},"https:\u002F\u002Fbugzilla.xamarin.com\u002Fshow_bug.cgi?id=53021",[186,470,468],{"href":468,"rel":471},[192],{"title":24,"searchDepth":39,"depth":39,"links":473},[],"2017-03-14T13:20:03.000Z","The current Xamarin Forms master detail template is broken.  You will get an error like Error CS0101 The namespace 'already contains a definition for.",{},"\u002Farticles\u002Fforms-master-detail-template",{"title":385,"description":475},"articles\u002Fforms-master-detail-template",[481],"xamarin","INsVAI3syQmOBP5U9aqAwo-8SVPG9zLItscvwFjbZ8Y",1781574765965]