Microsoft MVP성태의 닷넷 이야기
Queue out of memory [링크 복사], [링크+제목 복사],
조회: 23406
글쓴 사람
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가 아닙니다. 다시 계산해 보세요.
정성태

... 46  47  48  49  50  51  52  53  54  55  56  57  58  [59]  60  ...
NoWriterDateCnt.TitleFile(s)
1189Youn...12/10/201318947책을 사기전에 궁금한것이 있습니다. [1]
1188이민석12/5/201320317ocx 를 C#에서 마샬링관련 질문입니다.. [2]파일 다운로드1
1187이성환12/3/201321610WPF WebBrowser control의 자식 창이 close 되기 전 Navgate 재호출 문제 [2]파일 다운로드1
1186박종혁12/2/201319757책의 예제 중에 result 변수가 할당 되었지만 사용되지 않았다고 오류가 납니다!! [1]
1185박은희11/27/201321968멀티바이트로 개발한 프로그램을 유니코드로 변경시 쉽게 처리 하는법 [2]파일 다운로드1
1183박현수11/20/201318858WCF에서 web.config appsetting 읽기 [1]
1184박현수11/20/201320535    답변글 [답변]: WCF에서 web.config appsetting 읽기 [3]파일 다운로드1
1182유창우11/16/201329495자마린이 궁금... [8]
1181허관11/11/201318776책 샀습니다! [1]
1180김형지11/6/201323256안녕하십니까. 프로그램이 실행되지 않아 여쭙고자 합니다ㅠ [1]파일 다운로드1
1179이민석11/4/201323323[긴급질문] [in,out] 배열을 C# 에서 C/C++ 로 넘기는 방법 - 두번째 이야기 관련 질문.. [6]파일 다운로드1
1178박진영11/1/201322595[급질문] IIS 하위 가상폴더 구성 문의 [4]
1177Jeon...10/28/201318988안녕하세요~ 어머니께 물어서 사이트를 찾아왔어요 [2]
1176김태훈10/25/201319258AxWebBrowser에 대해 질문드립니다. [1]
1175서경희10/20/201324241netscape 지원이 되지 않는다는 문구.. [2]파일 다운로드1
1174임동찬10/16/201323658프리징 현상에 대한 고민 [5]
1173김재영10/8/201317887인터페이스에 대해 기초적 질문이 있습니다. [2]파일 다운로드1
1172박진영10/2/201320983웹사이트 연결시 AJAX 어셈블리 오류 문의드립니다. [5]파일 다운로드1
1171링거8/30/201329368ClickOnce 업데이트 문제. [4]
1170임동찬8/28/201320232비동기적 이벤트 핸들링 방법 [2]
1167나종식8/20/201319018win7 에서 LSP 가 DNS Client 에 인젝션 안되는 문제 [6]
1165임동찬8/19/201318448오류 발생시 로깅 문제.. [3]
1164박철8/19/201319138모바일 게임서버를 작성 하려면 무엇부터 시작하여야 하나요? [2]
1163안연준8/2/201318477음... 안녕하세요 ^^ 윈도우즈 폼에 대해서 잠시 물어볼께요 [3]
1162박진영7/23/2013168751개의 PC에서 동일사이트 접속제한을 어떻게 하죠? [1]
1161Ji Y...7/12/201319701안녕하세요? 음성인식 관련해서 질문있습니다, [2]
... 46  47  48  49  50  51  52  53  54  55  56  57  58  [59]  60  ...