memory,objects,class relationships

we know that memory is the basic requirement for all the things....even a variable occupy a memory in a space...my question is
we know that objects and methods are present inside the class in java ...my question is how the memory will be allocated....whether the memory will be shared or there will be separate allocation....if it is how it will be mapping objects into a memory
how it is done(with diagram) plz explain

Replies

  • gaurav.bhorkar
    gaurav.bhorkar
    Memory is generally allocated on stack and heap. It depends on your program and the compiler, is to how the memory allocation should be done.

    Remember, memory is not allocated by the compiler. The compiler just writes relative memory allocation table, the OS allocates memory at run-time.

    So, it also depends on your OS. Because it the stack is full, it will allocate memory at some other place.
  • computeridiot007
    computeridiot007
    thanks for ur reply ...can u tell me on xp and windows 7 about this case and take turboc and devc++
  • gaurav.bhorkar
    gaurav.bhorkar
    For C and C++ languages, memory allocation is done on the stack unless you specify it.
    Memory allocated using malloc () and new is always on heap.

    In newer languages like C# or python you are forced to allocate big objects on heap and small objects on stack.

    You must be knowing how much memory is allocated for int in 16 bit and in 32 bit.

You are reading an archived discussion.

Related Posts

uploading will affect the harddisk? plz someone tell me whether the uploading and downloading to and fro from the internet will affect the health of the harddisk....if it is then...
A simple improvement to wireless telephones would be to have a design that could be conveniently carried in one's pants pocket. In the USA, sets of wireless telephones are commonly...
Hi everybody as we are going to have an inter college fest, we need sponsors for that. can anyone help me out it's urgent. Thanks In ADVANCE
Hello every one this is karteek .I want final year project related on "VULNERABILITY DETECTION IN MOBILE COMPUTING ENVIRONMENT".Any one can please help me give an idea any vulnerability detection...
how to calculate shear force and bending moment calculation for hollow pipe tube when it is used as simply supported beam...?