Group:  English: General ยป microsoft.public.windows.powershell
Thread: get-content driving up powershell.exe mem usage

DotNetBag
.NET Development Newsgroups

HTVi
TV Discussion Newsgroups

Our Hot Pick: Rising Antivirus 2006 - Certified by TUV & Checkmark! Get 10% discount by entering this coupon code: ONDISCOUNT10
Rising Antivirus 2006

get-content driving up powershell.exe mem usage
"news.microsoft.com" <evetsleep[ at ]gmail.com> 11.07.2007 15:13:10
I'm not sure if this is a bug or not (sure does seem like it), but i have a
10mb file I threw at get-content and it never actually gets the content and
just sits there. Good thing i checked task manager because it went from
taking 78mb of memory to 1.5gb and was still growing. It seems to only go
this route with relatively large files (10mb+). Small text files work just
fine. All I did was:

get-contenct filename.txt | more

Any insight into what this is and if there is a way around it


RE: get-content driving up powershell.exe mem usage
RichS 11.07.2007 15:40:01
Its basically trying to read the file into memory before passing it down the
pipeline

You could try using -readcount to batch the number of lines in the file that
are read at once
--
Richard Siddaway
Please note that all scripts are supplied "as is" and with no warranty
Blog: http://richardsiddaway.spaces.live.com/
PowerShell User Group: http://www.get-psuguk.org.uk


"news.microsoft.com" wrote:

[Quoted Text]
> I'm not sure if this is a bug or not (sure does seem like it), but i have a
> 10mb file I threw at get-content and it never actually gets the content and
> just sits there. Good thing i checked task manager because it went from
> taking 78mb of memory to 1.5gb and was still growing. It seems to only go
> this route with relatively large files (10mb+). Small text files work just
> fine. All I did was:
>
> get-contenct filename.txt | more
>
> Any insight into what this is and if there is a way around it
>
>
>
RE: get-content driving up powershell.exe mem usage
Desmond Lee 11.07.2007 16:00:01
Try piping to out-host instead to cut out the intermediary that more.exe uses

i.e.

Get-Content filename.txt | Out-Host -paging

HTH.

--
............... All new, all fresh ..............
http://www.leedesmond.com/weblog/



"news.microsoft.com" wrote:

[Quoted Text]
> I'm not sure if this is a bug or not (sure does seem like it), but i have a
> 10mb file I threw at get-content and it never actually gets the content and
> just sits there. Good thing i checked task manager because it went from
> taking 78mb of memory to 1.5gb and was still growing. It seems to only go
> this route with relatively large files (10mb+). Small text files work just
> fine. All I did was:
>
> get-contenct filename.txt | more
>
> Any insight into what this is and if there is a way around it
>
>
>
Re: get-content driving up powershell.exe mem usage
"Kiron" <Kiron[ at ]HighPlainsDrifter.com> 11.07.2007 17:32:33
PowerShell has a function named 'more'.

Get-ChildItem Function:\more

Looking at its definition (either way)...

(Get-ChildItem Function:\more).definition
Get-Content Function:\more

....you can see that when reading files with 'more', is best to pass the
file's name --or full path-- instead of piping Get-Content's output to it.

more filename.txt--
Kiron

Re: get-content driving up powershell.exe mem usage
"Bart" <notsovalid[ at ]oiuytr.com> 11.07.2007 20:40:55
Check out this Blog entry from Keith hill

rgds,

Bart

"news.microsoft.com" <evetsleep[ at ]gmail.com> wrote in message
news:uNPs$38wHHA.3816[ at ]TK2MSFTNGP05.phx.gbl...
[Quoted Text]
> I'm not sure if this is a bug or not (sure does seem like it), but i have
> a 10mb file I threw at get-content and it never actually gets the content
> and just sits there. Good thing i checked task manager because it went
> from taking 78mb of memory to 1.5gb and was still growing. It seems to
> only go this route with relatively large files (10mb+). Small text files
> work just fine. All I did was:
>
> get-contenct filename.txt | more
>
> Any insight into what this is and if there is a way around it
>


Re: get-content driving up powershell.exe mem usage
"Keith Hill" <r_keith_hill[ at ]mailhot.moc.no_spam_I> 12.07.2007 02:23:34
Did you mean this one?

http://keithhill.spaces.live.com/blog/cns!5A8D2641E0963A97!756.entry

:-)

--
Keith

"Bart" <notsovalid[ at ]oiuytr.com> wrote in message
news:OtrcMv$wHHA.3944[ at ]TK2MSFTNGP06.phx.gbl...
[Quoted Text]
> Check out this Blog entry from Keith hill
>

Re: get-content driving up powershell.exe mem usage
"Bart" <notsovalid[ at ]oiuytr.com> 12.07.2007 06:55:28
Yep... forget to paste the link...

Great blog post !!!!


"Keith Hill" <r_keith_hill[ at ]mailhot.moc.no_spam_I> wrote in message
news:DB9E7179-301E-4B9F-8BD2-CA584A046711[ at ]microsoft.com...
[Quoted Text]
> Did you mean this one?
>
> http://keithhill.spaces.live.com/blog/cns!5A8D2641E0963A97!756.entry
>
> :-)
>
> --
> Keith
>
> "Bart" <notsovalid[ at ]oiuytr.com> wrote in message
> news:OtrcMv$wHHA.3944[ at ]TK2MSFTNGP06.phx.gbl...
>> Check out this Blog entry from Keith hill
>>
>


Re: get-content driving up powershell.exe mem usage
"news.microsoft.com" <evetsleep[ at ]gmail.com> 13.07.2007 09:17:35
Thanks all for the responses..appreciate it!

"news.microsoft.com" <evetsleep[ at ]gmail.com> wrote in message
news:uNPs$38wHHA.3816[ at ]TK2MSFTNGP05.phx.gbl...
[Quoted Text]
> I'm not sure if this is a bug or not (sure does seem like it), but i have
> a 10mb file I threw at get-content and it never actually gets the content
> and just sits there. Good thing i checked task manager because it went
> from taking 78mb of memory to 1.5gb and was still growing. It seems to
> only go this route with relatively large files (10mb+). Small text files
> work just fine. All I did was:
>
> get-contenct filename.txt | more
>
> Any insight into what this is and if there is a way around it
>


Home | Search | Terms | Imprint | Contact
Newsgroups Reader - provided by WiredBox.Net