Microsoft MVP성태의 닷넷 이야기
Queue out of memory [링크 복사], [링크+제목 복사],
조회: 13852
글쓴 사람
dev00
홈페이지
첨부 파일
 

안녕하세요^^

아래와 같은 상황에 대하여 궁금한점이 발생하여 질문드립니다.

제가 알기로는 QUEUE 에 크기는 무제한이라고 알고있는데 (제 컴퓨터 기준 중간에 OUT OF MEMORY가 뜹니다)

이유가 무엇인지 궁금합니다


추가1. 소스상의 for 구문중 i 가 134217728 일때 멈춥니다.
추가2. 혹시나하고 List<int>로해도 i가 134217728 일때 멈춥니다.

사용하고 있는 visualStudio는 2015 Commnuity 버전입니다.

---------소스코드----------------using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ConsoleApplication1
{
    class Program
    {
        static void Main(string[] args)
        {
            Queue<int> test1 = new Queue<int>();

            for(int i=0; i <1000000000; i++)
            {
                test1.Enqueue(i);
            }

            Console.Write("테스트");
        }
    }
}

----예외정보-------------------
System.OutOfMemoryException이(가) 처리되지 않았습니다.
  HResult=-2147024882
  Message='System.OutOfMemoryException' 형식의 예외가 Throw되었습니다.
  Source=System
  StackTrace:
       / System.Collections.Generic.Queue`1.SetCapacity(Int32 capacity)
       / System.Collections.Generic.Queue`1.Enqueue(T item)
       / ConsoleApplication1.Program.Main(String[] args) 파일 C:\Users\1234\documents\visual studio 2015\Projects\ConsoleApplication1\ConsoleApplication1\Program.cs:줄 18
       / System.AppDomain._nExecuteAssembly(RuntimeAssembly assembly, String[] args)
       / System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)
       / Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
       / System.Threading.ThreadHelper.ThreadStart_Context(Object state)
       / System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
       / System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
       / System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
       / System.Threading.ThreadHelper.ThreadStart()
  InnerException:








[최초 등록일: ]
[최종 수정일: 9/17/2016]


비밀번호

댓글 작성자
 



2016-09-17 10시56분
StringBuilder 에서의 OutOfMemoryException 오류 원인 분석
; http://www.sysnet.pe.kr/2/0/1171

.NET 64비트 응용 프로그램에서 왜 (2GB) OutOfMemoryException 예외가 발생할까?
; http://www.sysnet.pe.kr/2/0/946
정성태
2016-09-17 11시43분
[dev00] 정성태//답변감사합니다. 그런데 왜 2GB 바이트가 아니라 128MB 에서 멈추는걸까요?
[guest]
2016-09-18 01시31분
128MB가 아닙니다. 다시 계산해 보세요.
정성태

... 61  [62]  63  64  65  66  67  68  69  70  71  72  73  74  75  ...
NoWriterDateCnt.TitleFile(s)
1051최정수4/10/201213499WCF 클라이언트 비정상 종료 관련 [1]
1050에슈리온4/6/201215462관리자 권한과 ClickOnce, 그리고 Bootstrapper문제 [6]
1049김성혁4/4/201210178스마트클라이언트 stand-alone 방식의 배포 문제.. [1]
1048C#조으다3/27/201213915어셈블리 로드 / 언로드와 관련해서.. [6]
1047김우형3/23/201211645WCF 서비스를 이용한 데이터 전송 중 Exception 문의 [1]
1044임동찬2/29/201211500웹에서 COM Exception.. [2]
1043박성준2/24/201210322Lazy<T> 의 지연객체 생성 전에 실 객체의 Attribute분석 [2]파일 다운로드1
1042이성환2/20/201210710BlockingMethod에 빠진 스레드를 즉시 죽이고 싶습니다...;ㅅ; [2]파일 다운로드1
1039김재영2/15/20129880어셈블리에 사용자마다 다른 값을 적용하여 자동 빌드 방법이 있을까요? [2]
1037윈드로니2/12/201211357WPF 관련 질문 드립니다. [2]
1035임동찬2/9/20129703XML, XSD, XMLCodeGenerator 관련 [2]
1033곽성현2/7/20129977훔..윈도우 디바이스 드라이버 관련 [1]
1030궁빈2/2/201212378msbuild를 이용한 웹게시 및 자동 Dist 방법론에 대해 질문 드립니다!! [6]
1028신정환1/30/20129682기존 legacy Windows application이 WoA 환경에서 동작되지 않는 이유가 무얼까요? [2]
1026노현철1/19/201211442WPF가 XP에서 느리게 로딩되는 현상에 대해 질문드립니다. [4]
1025궁그미1/18/201212347네이버 소켓 로그인 이해가 안되는점이 있는데요 [2]
1022선무당1/11/201210590TFS 에서 공통 Assembly 공유 방법에 대해서 해결책이 없을까요? [2]
1021김재영1/8/20129772대리자를 메소드 파라메터로 넘겨도 됩니까? [2]파일 다운로드1
1019남산골11/13/201911888안녕하세요!! 성태님~~ [3]
1018강한구12/29/201115029WPF ClickOnce 배포시 콤포넌트 dll 다운로드 문제에 대하여 질문 있습니다. [1]
1017임동찬12/28/201112508smart client와 xbop, silverlight [6]
1015개똥이12/22/201110260RMCLOCK 설정 관련 질문이요ㅜ [2]
1011사길수12/16/201110054hyper-v 이더넷 카드 관련 문의 좀 드립니다. [1]
1006루로니12/13/201112261윈도우7과 XP의 DLL후킹 처리에 관해서 질문입니다. [3]
1005남산골12/13/201111943안녕하세요!! 첫 인사드립니다. [3]
1004뽀로로12/12/20119320Managed 어셈블리에서의 COM EntryPoint procaddress 문제 [1]
... 61  [62]  63  64  65  66  67  68  69  70  71  72  73  74  75  ...