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

... 16  17  18  19  20  21  22  [23]  24  25  26  27  28  29  30  ...
NoWriterDateCnt.TitleFile(s)
5381질문 있...9/4/202015722웹으로 사용하는 c#과 응용프로그램으로 사용하는 c#이 많이 다른가요?? [2]
5380yeon9/3/202015904winform 의 datagridview는 바인딩이 안 되나요? [1]
5379guest9/2/202019725시작하세요! C# 8.0 프로그래밍 책에 오타가 있습니다. [3]
5378net9/2/202016119mes 응용프로그램을 .net 웹폼으로 만들기도 하나요? [2]
5377net9/2/202014349.net 사용한 웹폼으로 응용프로그램을 만들경우 [1]
5376영귤9/1/202015633nullable 타입간의 비교연산은 그냥 가능한 건가요? [1]
5375영귤8/30/202017505이벤트와 델리게이트의 차이가 궁금합니다. [2]
5374guest8/27/202019970시작하세요! C# 8.0 프로그래밍 책에 오타가 있습니다. [1]
5373agj8/26/202017183System.Single::ToString()함수의 IL코드를 보았는데 ldnull, throw가 전부입니다. 왜 이렇게 짧죠? [2]
5372민성8/24/202017266안녕하세요 WPF 웹브라우저 컨트롤에서 웹브라우저 자체를 엣지로 할 수가 있나요? [2]
5371서현준8/11/202015894Hyper-V 내부 네트워크 환경 중, VM 에서 인터넷 접속 [1]
5370독자8/11/202013858.net createobject 관련 질문입니다.. [4]
5369독자8/10/202013612c# 8.0 프로그래밍 책에 대한 질문 드립니다 [1]
5368guest8/10/202015934시작하세요! C# 8.0 프로그래밍 책에 오타가 있습니다. [1]
5367박순기8/8/202013892디버깅 시 반전되는 부분 글 색상이나 배경색을 변경하는 방법 [3]파일 다운로드1
5366간절함8/7/202014513하나의 솔루션에서, 32비트 프로젝트에서 다른 64비트 프로젝트 참조하는 방법 궁금합니다. [4]
5365영귤8/6/202014054TimeSpan 구할 때 시간대를 바꿔도 같은 값이 나오는 것 같습니다. [1]
5364박순기8/5/202014165visual studio의 menu bar font size 변경방법 문의 [2]파일 다운로드1
5363클락8/1/202015234c# 9.0 출간 준비 중이신가요? [2]
5361하태7/29/202014283안녕하세요! 바이너리데이터 파싱 질문 드리겠습니다!. [2]
5360진우7/28/202015552엑셀에서 발생하는 모든 이벤트를 감지 할수 있는지 궁금합니다. [6]파일 다운로드1
5358홍길동7/22/202014058개체에서 open 속성이나 매서드가 지원 되지 않읍니다.라고 오류창이 뜨는데. [1]
5357손동섭7/22/202014907책 예제코드... [3]
5355neska7/21/202014283안녕하세요 문의 드립니다 [1]
5354민성7/15/202016850안녕하세요 db연결 문자 보안 [2]
5353형성재7/14/202015557Visual Studio Setup Project에서 VC++2010재배포패키지설치 [4]
... 16  17  18  19  20  21  22  [23]  24  25  26  27  28  29  30  ...